Results 1 to 4 of 4

Thread: construct a simple table from XML files using XSLT

  1. #1
    Join Date
    Jul 2006
    Posts
    191

    construct a simple table from XML files using XSLT

    Hi guys,


    I am trying to construct a simple table from XML files using XSLT .I would
    like to put an ID from the document in column 1, and the content of some
    elements that maybe repeated in column 2. Can this be done in a template using a for-each, or should I use a sort of variable, or?

    Desired output:

    7817471 author1

    7817471 author2

    7817471 author3

    7817472 author1

    7817472 author2

    the ID of each document would be in /inspec/article/contg/accn and the repeated elements in e.g., /inspec/article/bibliog/aug/pname

    Thanks for any help!

  2. #2
    Join Date
    Feb 2008
    Posts
    1,852

    Re: construct a simple table from XML files using XSLT

    Can you post the XML you want to process? Based on the above I would guess you might want
    <xsl:for-each select="/inspec/article/bibliog/aug/pname">
    <xsl:value-of select="concat(../../../contg/accn, ' ', .,
    ' ')"/>
    </xsl:for-each>

  3. #3
    Join Date
    Jul 2006
    Posts
    191

    Re: construct a simple table from XML files using XSLT

    Thanks - it works beautifully! Also on other elements as long I get the
    relative path correct.
    Can I somehow limit the match on pnames to the ones that have a certain
    attribute, e.g., "@order = first"?

  4. #4
    Join Date
    Feb 2008
    Posts
    1,852

    Re: construct a simple table from XML files using XSLT

    Sure, simply add a predicate with that condition:
    <xsl:for-each select="/inspec/article/bibliog/aug/pname[@order =
    'first']">

Similar Threads

  1. Not able to do a simple RAR of files
    By Kausty in forum Windows Software
    Replies: 2
    Last Post: 24-10-2011, 07:24 PM
  2. Link a Table to another Table to Drop Down In Main Table
    By himeshRES in forum Windows Software
    Replies: 6
    Last Post: 11-12-2010, 02:01 PM
  3. Replies: 5
    Last Post: 30-11-2010, 07:38 AM
  4. How to construct a simple filter driver for USB
    By Appaji in forum Software Development
    Replies: 4
    Last Post: 21-02-2010, 06:41 AM
  5. Replies: 11
    Last Post: 30-11-2009, 10:19 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,619,618.51749 seconds with 17 queries