[PHP] Embed XHTML code using PHP's XSLT processor

2006-01-30 Thread Markus Fuchs
This'll be a rather long post because of the code snippets, so please bear
with me.

I'm trying to embed XHTML code from a XML file and I'm wondering why PHP's
XSLT doesn't indent it correctly.

So, this stylesheet:



http://www.w3.org/1999/XSL/Transform";>
http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd";
  media-type="application/xhtml+xml"
  omit-xml-declaration="yes" />


  http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">

  

  








  

  

  


  




applied to this document:






  

  
  

  


  

  


produces this output:


http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd";>
http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
  
  


  



If I set "indent" to "no", then it produces this output:


http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd";>
http://www.w3.org/1999/xhtml"; xml:lang="en"
lang="en">
  


  



- Is it possible to indent the XHTML code from the XML file so that it fits
the rest of the (XHTML) document, and if so, how?
- Is it a namespace or white-space/CR/LF problem?

Any help appreciated!

Markus

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Embed XHTML code using PHP's XSLT processor

2006-01-31 Thread Markus Fuchs
Thanks for your response, Björn.

"Björn Bartels" wrote:
> Hi ,
>
> this happens because a xml-parser (your browser,...) has to remove all
> spaces, etc.which are not nessesary.

Why doesn't 'xsl:element' indent the xml data according to the ident switch
("yes"/"no") then? I expected that the complete resulting XHTML (generated
by the XSLT processor) is either indented or it's completely not indented.
Unfortunately this is not the case for the imported XHTML from the XML file.

>
> hope that helps
>
> bb

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Embed XHTML code using PHP's XSLT processor

2006-02-02 Thread Markus Fuchs
"Björn Bartels" wrote:
> Moin, moin...

Moin. :-)

> I'm only 99% sure but I think in this line...
>
> 
>
> ..."node()" returns "CDATA" which drops
> those unnessasary whitespaces and cr/lf's...

Okay, we're almost there, I guess. ;-) I still need your help, though.
If I change my XML from


  

  
  

  


to



(all nodes in one single line), the resulting XHTML get correctly indented
for both indent switch settings.
Unfortunately I can't get it to work when I indent the XML data (like in my
first post). Neither normalize-space() nor translate() does the trick...
What am I missing?

Thanks,
Markus

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php