[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: is ID definition in DTD necessday for id()

Subject: Re: is ID definition in DTD necessday for id()
From: "Joerg Heinicke" <joerg.heinicke@xxxxxx>
Date: Thu, 20 Dec 2001 20:10:42 +0100
dtd id definition
This is because of the built-in templates. You can change the matcher to
'bla' and it will work too. The processing is not dependent on the templates
but on the node-order in the xml. For every node, which "has" a template,
this template will be used, otherwise the built-in template shows the
text-value of this node. You can change your stylesheet in another way too
for seeing the effect:

> <xsl:template match="id('x123')">
>     <i><xsl:value-of select="."/></i>
> </xsl:template>

So you should see "Hello World" in italic. If not, the built-in template is
used.

Joerg

----- Original Message -----
From: "Steve Renshaw" <renshaw_steve@xxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Thursday, December 20, 2001 7:11 PM
Subject: Re:  is ID definition in DTD necessday for id()


> I thought it was necessary initially, but the following xml and xsl
display
> "Hello World" in IE6 whether the doctype in included or not.
> Am I msising something ehre?
>
> doit.xml
> =========
> <?xml version="1.0"?>
> <!DOCTYPE root [
> <!ELEMENT root (item)>
> <!ELEMENT item (#PCDATA)>
> <!ATTLIST item id ID #REQUIRED>
> ]>
> <?xml-stylesheet type="text/xsl" href="doit.xsl"?>
> <root><item id="x123">Hello World</item></root>
>
> doit.xsl
> =========
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>
> <xsl:template match="id('x123')">
>       <xsl:value-of select="."/>
>    </xsl:template>
>
> </xsl:stylesheet>
>
> >From: David Carlisle <davidc@xxxxxxxxx>
> >Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> >To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> >Subject: Re:  is ID definition in DTD necessday for id()
> >Date: Thu, 20 Dec 2001 17:28:36 GMT
> >
> > > Quick questions -is it needed to use a dtd definition in the XML
> > > source
> >
> >yes, the attribute does not need to be called id the only thing that
> >matters is that it has been declared as type ID in a dtd.
> >
> > > - it isn't a function or is it?
> >It's a function, it takes a string valued argument and returns a node
> >set.
> >
> >David


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.