xsl-list
[Top] [All Lists]

Re: [xsl] Need help finding invalid references to target IDs

2008-06-26 11:28:31
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(_dot_)hintz(_at_)siemens(_dot_)com> 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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>