xsl-list
[Top] [All Lists]

RE: Encapsulating and displaying html fragments

2004-05-15 03:57:08
-----Original Message-----
From: Shaun ONeil [mailto:shaun(_at_)oneil(_dot_)me(_dot_)uk]

Hi,

So what I ask, is which behaviour is actually correct, and how do I work
around this issue?

<snip />

Is there any reason in particular why your input looks the way it does?

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="testcase.xsl"?>
<test>
  <fragment>&lt;p&gt;A &lt;acronym title="HyperText Markup
Language"&gt;HTML&lt;/acronym&gt; fragment&lt;/p&gt;</fragment>
</test>


The content of the fragment node is actually valid XML, so why not just make
it:

<fragment>
  <p>A <acronym title="HyperText Markup Language">HTML</acronym>
fragment</p>
</fragment>

to begin with. Then you won't need d-o-e after all, just use

<xsl:copy-of select="fragment/p" />

to copy it to the result tree...


HTH!

Greetz,

Andreas



<Prev in Thread] Current Thread [Next in Thread>