Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
| Search | Today's Posts | Mark Forums Read
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 April 10th, 2007, 09:23 AM
Authorized User
 
Join Date: Mar 2007
Location: , , .
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Converting XML into a particular format using XSLT

I am trying to convert the undermentioned XML into the the flwg
format:

Code:
XML Code:

<?xml version="1.0" encoding="UTF-8"?>
<FIXML xmlns="http://www.fixprotocol.org/FIXML-4-4">
<Order Acct="1" MinQty="10" Px="480.25" SettlDt="2009-12-01" StopPx="480.25" ><Hdr SID="DUMMULSEHUB" SeqNum="2" Snt="2007-04-05T13:34:47" TID="HSBC"/><PreAll Acct="2" Qty="1000"/><TrdSes SesID="0"/><Instrmt CpnRt="5.1" EncIssrLen="2" ID="3134865" Sfx="P" Src="2" /><OrdQty Cash="1" Qty="500"/></Order></FIXML>

INTO THE Format:
----------------

<i:Acct>1</i:Acct> 
<i:MinQty>10</i:MinQty> 
<i:StopPx>480.25</i:StopPx>
I am using the undermentioned,but the value doesnt appear

Code:
<xsl:template match="/">
    <1:Acct>
        <xsl:value-of select="Order/@Acct"/>
    </i:Acct>


    </xsl:template>


</xsl:stylesheet>
Can someone please tell me the correct way if possible.
Help appreciated very much.


 
Old April 10th, 2007, 09:47 AM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Your elements are in a namespace so your path expressions need to refer to them by prefixed names. Please see the first "sticky" post in this forum (link to default namespaces at the end), or google for "XSLT default namespace).

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference




Similar Threads
Thread Thread Starter Forum Replies Last Post
Difficulties converting XML to XML using XSLT Reznik XSLT 7 June 3rd, 2008 05:45 AM
Converting to FoxPro 2.6 Format msnayak21 ADO.NET 1 June 25th, 2007 12:27 PM
Converting to FoxPro 2.6 Format msnayak21 SQL Server 2005 2 May 11th, 2007 05:01 AM
Converting to FoxPro 2.6 Format msnayak21 .NET Framework 2.0 0 May 10th, 2007 05:27 AM
Converting to FoxPro 2.6 Format msnayak21 ASP.NET 2.0 Professional 0 May 10th, 2007 05:23 AM





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