[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: generate-id() explanation
On 24/05/2010 17:29, a kusa wrote:
Hi
yes or even within multiple documents (in the same transform) generate-id() is guaranteed to give a different string for each node.
Note generate-id(0 is an easy way of generating ids but if it is for a public facing document then beware that it makes URI refereces that are inherently opaque and unstable rather than having http://example.com/foo.html#section3.4 you get http://example.com/foo.html#njagsd3672 and should you have course to generate that document again 9possibly without even changing the source) all the URI references change and might become http://example.com/foo.html#npiu6ogljgk compare http://www.w3.org/TR/2001/REC-MathML2-20010221/chapter3.html#N4116 and the URI ref to the 2nd edition which is http://www.w3.org/TR/MathML2/chapter3.html#id.3.1.2 the default xmlspec stylesheets use a fragment identifier based on an id attribute in the source if there is one, and use generate-id() if not but for mml2 2nd edition I changed thigs round so that if there is no id it generated an id using xsl:number, which is far more stable between drafts as the text was edited. David ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|