[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] value of NDATA Entities in attributes


Subject: [xsl] value of NDATA Entities in attributes
From: James Cummings <James.Cummings@xxxxxxxxx>
Date: Mon, 11 Aug 2003 16:27:09 +0100 (BST)

Hi there,

Although this is probably a sick way of doing things,
I have some documents where there is an xptr element
whose attribute href is declared in the DTD as:
<!ATTLIST xptr href ENTITY #REQUIRED>

The entities for these are created as:
<!NOTATION FOO SYSTEM 'text/xml'>
<!ENTITY Blort SYSTEM 'Blortfile.xml' NDATA FOO>
<!ENTITY Wibble SYSTEM 'Wibblefile.xml' NDATA FOO>
(etc.)

Although a little warped this does certainly make sure
that things are given as <xptr href="Blort" other="attrib" />
if blort is used instead, it does not validate.

The question is, since the Blort entity is declared as
NDATA, is it possible to retrieve the string 'Blortfile.xml'.

On the surface you'd think something like:
<xsl:template match="xptr">
<xsl:value-of select="@href"/>
</xsl:template>

when matching <xptr href="Blort" other="attrib" />
would output 'Blortfile.xml'.  However (probably
quite sensibly) it instead outputs 'Blort'.

Assuming that I cannot change the XML, is there
a fairly straightforward change I could make to
the DTD / Entities that would keep the
validation requirement ('Blort' not 'blort') but
return the string 'Blortfile.xml' in the XSL.  Or
is there a way in the XSL to get this that I'm
missing entirely?

I just keep coming up with silly questions like this
don't I?

-James
-- 
Dr James Cummings, James.Cummings@xxxxxxxxx, http://www.uea.ac.uk/~q503
Cursus Project, School of Music, University of East Anglia,
Norwich, Norfolk, NR4 7TJ, UK  Tel:(01603)593-595



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords