This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: CDATA block to node set.
- From: Morten Primdahl <morten at it-c dot dk>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Thu, 09 May 2002 22:31:44 +0200
- Subject: Re: [xsl] CDATA block to node set.
- References: <000001c1f791$bf9c88b0$0400a8c0@fcmobilexpp>
- Reply-to: xsl-list at lists dot mulberrytech dot com
I know that my question may seem that of a delusional madman.
But I'm well aware of what CDATA is, I had just hoped to access it
the same way one can access data from a URL:
<xsl:template match="xmlref">
<xsl:variable name="content" select="document(@url)/*"/>
<!-- do stuff here -->
</xsl:template>
I've devised a small compositional query language based on XSLT,
purely for academic reasons. It looks like:
xslquery := <xmlref url="..."/> | <xmldata> XML </xmldata> |
<select>xlsquery<from>xslquery</from></select>
The DTD:
<!DOCTYPE xslquery [
<!ELEMENT xslquery (select|xmlref|xmldata)>
<!ELEMENT select (xslquery, from)>
<!ELEMENT from (xslquery)>
<!ELEMENT xmldata (#PCDATA)>
<!ELEMENT xmlref EMPTY>
<!ATTLIST xmlref url CDATA #REQUIRED>
]>
I asked because the case where the xmldata holds another xslquery
can be possible. Usually the xmldata element holds just source
XML, which is why the CDATA approach was chosen, so I could parse
the query for well-formedness. But in cases where the content is
indeed an xslquery, I would like to be able to process that,
compiling it into the target language (eg. Java).
I guess my best bet is to
1. Make my xsltql2java.xsl compiler stylesheet namespace aware.
2. Use an XSL Schema with lax parsing on the xmldata element and
ditch the DTD.
Thanks,
Morten
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list