xsl-list
[Top] [All Lists]

RE: [xsl] Check for duplicate @id's - collection()

2008-07-19 08:44:39

<xsl:for-each-group select="collection(...)//@id" group-by=".">
  <xsl:if test="count(current-group()) ne 1">
    <xsl:message>Id value <xsl:value-of select="current-grouping-key()"/> is
duplicated in files
      <xsl:value-of select="current-group()/document-uri(/)" separator=" and
"/></xsl:message>
  </xsl:if>
</xsl:for-each-group>

Michael Kay
http://www.saxonica.com/

-----Original Message-----
From: Philip Vallone [mailto:philip(_dot_)vallone(_at_)verizon(_dot_)net] 
Sent: 19 July 2008 16:28
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Check for duplicate @id's - collection()

Hi,
 
I have a project were I take about 800 files and transform 
them into one .fo document (create a pdf). The files are 
authored independent of each other (stand alone) which are 
validated against a schema (independently). If there is a 
duplicate @id attribute, the validator will tell me. However, 
the @ids need to be unique across all files processed by the 
collection function. If they are not, my resulting .fo will 
have duplicate @ids, which cause FOP to halt.

I am looking for a way to (query or xslt 2.0) to check for 
duplicate @id's values across all files with the collection 
function. This would be a pre-production check.

I am looking for ideas or suggestions. Also, I am using Saxon 9.1.0.1

Thanks,

Phil






--~------------------------------------------------------------------
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>
--~--