Altova Mailing List Archives

Re: [xsl] Referencing content in XML and then processing in XSLT 2.0

From: Andrew Welch <andrew.j.welch@-----.--->
To: xsl-list@-----.------------.---
Date: 3/23/2010 9:05:00 AM
> Is there any way I can use my own "id" name for this, e.g.
> "domain-id", or does XSLT expect refs to always point to "id". I am
> trying to steer clear of the reserved "id" attribute since I may one
> day need to include and preserve external data id's as well as my own.

You can use whatever you like - "domain-id" and "domain-ref" for
example.  "id" isn't reserved by the way, so you could use that now.

id/idrefs I've never used (as I don't see the point) but they only
work when your xml is validated to mark certain fields as ids.  Simply
having an attribute called "id" isn't enough for the id() function to
return it.

> Also, is there any way to make your solution work if the referencing
> content is inside an attribute of an element
> e.g. <company product="The editor &lt;producttype-ref
> ref-id=&quot;manual1&quot;/&gt;">

That looks awful.  Escaped markup is nearly always wrong.  Why not make it:

  <product>The editor <producttype-ref ref-id="manual1">

Andrew Welch

XSL-List info and archive:
To unsubscribe, go to:
or e-mail: <mailto:xsl-list-unsubscribe@l...>


These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.