forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikael Sitruk" <mikae...@bezeqint.net>
Subject RE: Question: adding formatting for 'xml' conent of source element
Date Mon, 09 Jun 2003 06:19:52 GMT
David hi

The <source><![CDATA[ - is not working, since the element inside are not
interpreted as element!
For example:
<source><![CDATA[
<function name="AA">
dsdsd
</function>
]]>
</source>

In XSL: 
<xsl:template match="source">
<xsl:value-of select="function"/>
</xsl:template>

This will return nothing since the XML processor doesn't understand the
CDATA content as XML but as string.

If I do the formatting prior e.g. in external document, then run an XSL
to get to a document that validate the document-v11.dtd, using the CDATA
then the processor will send the content of the XML to the HTML but the
formatting will not be interpreted as HTML tag:
Example:
<source><![CDATA[<font color="blue">&lt;</font>function name="AA"
&gt;
.....
...
]]>
</source>

In XSL: 
<xsl:template match="source">
>xsl:value-of select="."/>
</xsl:template<

will show in the browser:
<font color="blue">&lt;</font>function name="AA" &gt; .....
and not <function name="AA"> where the "<" is in blue.
I've also tried the disable-output-escaping, it doesn't seems to work.

If there is a function to translate the xml string to xml node it may
help, but I don't know such one, exept if the xml is stored in a
separate file, and that what I will try...

Mikael.S


-----Original Message-----
From: David Crossley [mailto:crossley@indexgeo.com.au] 
Sent: Monday, June 09, 2003 04:30
To: forrest-dev@xml.apache.org
Subject: RE: Question: adding formatting for 'xml' conent of source
element

Mikael Sitruk wrote:
> Jeff hi 
> 
> I've already tried this, but the ANY declaration tells the XML
validator
> that ANY of the declared element in the DTD is legal. I can't override
> the DTD for each of the xml samples I want to add, it will be a
> nightmare.

Can we go back to discussing using <source><![CDATA[ ... in the xml
instance.
Why does that cause you a problem with later processing? Perhaps we are
trying
to solve the wrong issue.

--David



Mime
View raw message