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

unique elements from different sourcefile

Subject: unique elements from different sourcefile
From: Thomas Winkler <t.winkler@xxxxxxxxxxx>
Date: 03 Jan 2002 14:31:21 +0100
unique elements
hi,
i'm really having a hard time figuring this little problem. because of
simplicity and performance i used the muench method for finding unique
elements and whatever else i needed. but this one just doesn't work for
me. maybe i'm just too desperate to solve it myself....

i have a xml represantation of a dtd, generated by norman walshs
dtdparse script in a separate xml file.

all i want is getting all possible children of a specific element. since
the content model of some elements can be very complicated (such as
"head"), most xpath axis don't work. 

i looked through the faq, but the methods with the following axis are
not working either. maybe someone could help me through this little one.

<dtd>
<element name="head" content-type="element">
<content-model-expanded>
  <sequence-group>
    <or-group occurrence="*">
      <element-name name="meta"/>
      <element-name name="link"/>
      <element-name name="object"/>
    </or-group>
    <or-group>
      <sequence-group>
        <element-name name="title"/>
        <or-group occurrence="*">
          <element-nam name="meta"/>
          <element-name name="link"/>
          <element-name name="object"/>
        </or-group>
        <sequence-group occurrence="?">
          <element-name name="base"/>
          <or-group occurrence="*">
            <element-name name="meta"/>
            <element-name name="link"/>
            <element-name name="object"/>
          </or-group>
        </sequence-group>
      </sequence-group>
      <sequence-group>
        <element-name name="base"/>
        <or-group occurrence="*">
          <element-name name="meta"/>
          <element-name name="link"/>
          <element-name name="object"/>
        </or-group>
        <sequence-group>
          <element-name name="title"/>
          <or-group occurrence="*">
            <element-name name="meta"/>
            <element-name name="link"/>
            <element-name name="object"/>
          </or-group>
        </sequence-group>
      </sequence-group>
    </or-group>
  </sequence-group>
</content-model-expanded>
</element>
</dtd>

i think i have to use at least two for loops, because if i generate the
ids in one for loop as usual (without document() function) the first
ones are not always identical and the xsl:for-each and xsl:key are not
at the same nodeset. do i first have to 

<xsl:for-each
select="document($xsldtdfile)/dtd/element[@name=current()]/content-model-expanded">

and then 

<xsl:for-each select=".//element-name">

with

<xsl:key name="uChilds" match=".//element-name" use="@name" />

????

what do my xsl:key and xsl:for-each(s) have to look like. i tried many
things, i just don't want to write here.

thank you for your help.

thomas winkler



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.