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

Re: flattening an xml hierarchy

Subject: Re: flattening an xml hierarchy
From: Tim <timlhunt@xxxxxxxxxxxxxx>
Date: Thu, 08 Jan 2009 12:34:21 -0500
Re:  flattening an xml hierarchy
I thought a simple example would be able for me to extrapolate to one with namespaces. When I run your transform with
<xsl:template match="GetNextDocumentResponse | GetNextDocumentResult | Document">
replacing
<xsl:template match="Dontwant1 | dontwant2">


I get the unwanted elements as well.


I am looking to remove the top three elements of the below [accurate] example:
<GetNextDocumentResponse xmlns="http://www.BargeEx.com/BargeExService">
<GetNextDocumentResult>Success</GetNextDocumentResult>
<Document>
<EquipmentStatusDocument xmlns="urn:x12:schemas:BEX200808:StatusDocuments">
<DocumentHeader/>
<DocumentDetail>
....
</DocumentDetail>
</DocumentHeader/>
</EquipmentStatusDocument>


Thanks, again.
Tim


Martin Honnen wrote:
Tim wrote:

I'd like to remove some elements from an xml hierachy using xslt:

Original xml example:
<Dontwant1>
   <dontwant2>foo</dontwant2>
   <x3>
       <x4>stuff</x4>
       <y5>more stuff</y5>
   </x3>
</Dontwant1>

Like to have transform output:
<x3>
  <x4>stuff</x4>
   <y5>more stuff</y5>
</x3>

<xsl:template match="@* | node()"> <xsl:copy> <xsl:apply-templates select="@* | node()"/> </xsl:copy> </xsl:template>

  <xsl:template match="Dontwant1 | dontwant2">
     <xsl:apply-templates select="*"/>
  </xsl:template>

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.