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

Re: Need help finding invalid references to target IDs

Subject: Re: Need help finding invalid references to target IDs
From: "Darcy Parker" <darcyparker@xxxxxxxxx>
Date: Thu, 26 Jun 2008 14:27:53 -0400
Re:  Need help finding invalid references to target IDs
Hi Dave,

Here's one approach:

At the beginning of your XSL, make a key for @id attributes in the document.

Then for each @refid in the document, check if there is a matched key.
 If it doesn't report an error.

(Schematron is one way you could check this quickly... But if you want
a lighter weight XSLT, it should be simple to do.)

Darcy
On Thu, Jun 26, 2008 at 2:10 PM, Hintz, David L <david.hintz@xxxxxxxxxxx> wrote:
> Hi,
>
> This is probably a newbie question, although I've hacked a lot of XSLT
> for about a year.  This problem has me stumped, however.
>
> Our schema has numerous elements with "id" attributes (target IDs) and
> several with "refID" attributes (reference IDs).  Unfortunately, these
> are not defined as ID and IDREF respectively or I wouldn't be having
> this issue.  I need to compare all of the "refID" attributes in a
> document against all of the "id" attributes and generate a report
> showing the "refID" attributes that do not have a valid target.  I know
> this is probably only a few lines in XSLT, but I'm not sure where to
> even start to do this test.
>
> Can anyone get me started?
>
> Dave Hintz

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.