Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 8th, 2013, 09:43 AM
Registered User
 
Join Date: Feb 2013
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey hi Martin,

But this adjusted xslt doesn't work and if i add a namespace to the xml like this

<receipt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<manufacturer>1</manufacturer>
<manufacturer_gln/>
<transfer_recipt/>
<prod>
<product_GTIN/>
<product_LOT/>
<production_date/>
<expire_date/>
<carrier id="123">
<carrier_type>1</carrier_type>
</carrier>
<carrier id="234">
<carrier_type>2</carrier_type>
</carrier>
<carrier id="456">
<carrier_type>3</carrier_type>
</carrier>
<personaldetails>
<person id="123" perid="1">
<fn>fn1</fn>
</person>
<person id="123" perid="2">
<fn>fn2</fn>
</person>
<person id="123" perid="3">
<fn>fn3</fn>
</person>
<person id="234" perid="4">
<fn>fn4</fn>
</person>
<person id="234" perid="5">
<fn>fn5</fn>
</person>
<person id="456" perid="6">
<fn>fn3</fn>
</person>
</personaldetails>
</prod>
</receipt>


and my output xmls

file1.xml

<receipt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<manufacturer>1</manufacturer>
<manufacturer_gln/>
<transfer_recipt/>
<prod>
<product_GTIN/>
<product_LOT/>
<production_date/>
<expire_date/>
<carrier id="123">
<carrier_type>1</carrier_type>
</carrier>
<personaldetails>
<person id="123" perid="1">
<fn>fn1</fn>
</person>
<person id="123" perid="2">
<fn>fn2</fn>
</person>
<person id="123" perid="3">
<fn>fn3</fn>
</person>
</personaldetails>
</prod>
</receipt>

file2.xml


<receipt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<manufacturer>1</manufacturer>
<manufacturer_gln/>
<transfer_recipt/>
<prod>
<product_GTIN/>
<product_LOT/>
<production_date/>
<expire_date/>
<carrier id="234">
<carrier_type>2</carrier_type>
</carrier>
<personaldetails>
<person id="234" perid="4">
<fn>fn4</fn>
</person>
<person id="234" perid="5">
<fn>fn5</fn>
</person>
</personaldetails>
</prod>
</receipt>

<receipt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<manufacturer>1</manufacturer>
<manufacturer_gln/>
<transfer_recipt/>
<prod>
<product_GTIN/>
<product_LOT/>
<production_date/>
<expire_date/>
<carrier id="456">
<carrier_type>3</carrier_type>
</carrier>
<personaldetails>
<person id="456" perid="6">
<fn>fn3</fn>
</person>
</personaldetails>
</prod>
</receipt>

Can u give me a solution..
Thank you.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Split large XML to smalls nzvtvsky9 XSLT 1 January 13th, 2010 01:48 PM
Split xml file with result document and javax.xml.transform.Transformer. nisargmca XSLT 3 January 12th, 2010 06:26 AM
Regarding xml-html transformation of an xml string using xslt and javascript suprakash444 XSLT 1 January 12th, 2009 01:23 AM
Convert 1 big XML to multiple smaller XML victorcorey XSLT 1 March 20th, 2008 05:59 AM
XSLT for complicated xml to xml transf. required doug@sirvisetti XSLT 3 June 17th, 2005 04:26 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.