Re: [xsl] CDATA block to node set.

Subject: Re: [xsl] CDATA block to node set.
From: Morten Primdahl <morten@xxxxxxx>
Date: Thu, 09 May 2002 22:31:44 +0200

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



Current Thread