Martin Honnen <ma*******@yahoo.de> wrote in message news:<40********@olaf.komtel.net>...
Xtr wrote:
Is it possible, using xsl, to indent most tags, but preserve the
position of tags that are inline (surrounded by text)?
For example, given the following,:
<text><p>text<b>text</b></p></text>
<text><p>text<b>text</b></p></text>
have it output like this:
<text>
<p>text<b>text</b></p>
</text>
<text>
<p>text<b>text</b></p>
</text>
Can this, for example, be done by using indent="yes" and using some
kind of exception for certain tags?
If you use indent yes and <xsl:output method="html"> then the XSLT
processor usually does try to keep text in HTML containers like <p> ir
HTML inline elements like <b> as it is output in the result elements.
With output method xml it is usually not clear to a processor what the
semantics of your <p> or <b> elements is.
I need to output to plain XML. What would solve my problem would be a
way to specify certain element-types that should always be inline
within the parent element.
I guess it would be possible to create a "function" in XSLT that
parses every element and indents the element based on its position or
"layer" within the xml-file. This function would then indent some
elements and put some inline.
However, if it is possible to use indent="yes", I would rather like to
do that to keep things simple.