ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> xsl-list
xsl-list
Re: [xsl] is ID definition in DTD necessday for id()
by Steve Renshaw other posts by this author
Dec 20 2001 6:11PM messages near this date
RE: [xsl] selecting a perticular node | Re: [xsl] 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@[...].uk>
> Reply-To: xsl-list@[...].com
> To: xsl-list@[...].com
> Subject: Re: [xsl] 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
> 
> _____________________________________________________________________
> This message has been checked for all known viruses by Star Internet
> delivered through the MessageLabs Virus Scanning Service. For further
> information visit http://www.star.net.uk/stats.asp or alternatively call
> Star Internet for details on the Virus Scanning Service.
> 
>   XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
Thread:
Steve Renshaw
David Carlisle
Joerg Heinicke

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved