I am using my own namespace called xmlns:i="http://www.ABC/int:i"
in my XSL style sheet.
The input XML document (which has its own namespace) needs to be
mapped with the elements defined in my namespace.
1)The Input XML Document generated and given is as follows: -
<?xml version="1.0" encoding="UTF-8"?>
-
<?xml-stylesheet type="text/xsl"?>
-
<FIXML xmlns="http://www.fixprotocol.org/FIXML-4-4">
-
<Order Acct="1" ExDest="ExchDest">
-
<Hdr SeqNum="2" Snt="2007-04-05T13:34:47" />
-
<Instrmt Issr="Barclays" MMY="200903" />
-
<OrdQty Cash="1" Qty="500"/>
-
</Order>
-
</FIXML>
-
-
-------------------------------------------------
-
The resultant Output should be as:
-
-------------------------------------------------
-
<i:ID>1</i:ID>
-
<i:Date Format="dd mmm yyyy hh:mm:ss">2007-04-05T13:34:47 </i:Date>
-
<i:Underlying value="YEN>
-
<sample:ISSR>Barclays</sample:ISSR>
-
</i:/Underlying>
-
-
-------------------------------------------------
-
The XSL I am using is this
-
------------------------------------------------
-
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-
xmlns:i="http://www.ABC/int:i" >
-
-
<xsl:template match="FIXML">
-
<xsl:apply-templates select ="Order"/>
-
</xsl:template>
-
<xsl:template match="Order">
-
-
<OrderDet>
-
<i:ID>
-
<xsl:value-of select="@Acct"/>
-
</i:ID>
-
</OrderDet>
-
-
<i:Date>
-
<xsl:attribute name="Format">
-
<xsl:value-of select="Instrmt/@MMY" />
-
</xsl:attribute>
-
</i:Date>
-
-
</OrderDet>
-
-
If I include the namespace xmlns:i="http://www.ABC/int:i" in my XSL,
-
this gets displayed as an attribute of element OrderDet.
-
-
<OrderDet xmlns:i="http://www.tfs.com/common/interests:i">
-
-
1)I dont what this to be an attribute of OrderDet element.
-
-
2) How can I map the input XML elements to my namespace i:
-
if I dont include my namspace i: in my XSL.?
-
-
It gets a bit frustrating to include i: as a prefix to
-
every element in my XSL
-
-
Is there a mapping or a better way to do it.
-
-
Help really appreciated.
-
-
-
-
-
-
-
1 1357 Dököll 2,364
Recognized Expert Top Contributor
[HTML]
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl"?>
<FIXML xmlns="http://www.fixprotocol .org/FIXML-4-4">
<Order Acct="1" ExDest="ExchDes t">
<Hdr SeqNum="2" Snt="2007-04-05T13:34:47" />
<Instrmt Issr="Barclays" MMY="200903" />
<OrdQty Cash="1" Qty="500"/>
</Order>
</FIXML>
-------------------------------------------------
The resultant Output should be as:
-------------------------------------------------
<i:ID>1</i:ID>
<i:Date Format="dd mmm yyyy hh:mm:ss">2007-04-05T13:34:47 </i:Date>
<i:Underlying value="YEN>
<sample:ISSR>Ba rclays</sample:ISSR>
</i:/Underlying>
-------------------------------------------------
The XSL I am using is this
------------------------------------------------
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
xmlns:i="http://www.ABC/int:i" >
<xsl:template match="FIXML">
<xsl:apply-templates select ="Order"/>
</xsl:template>
<xsl:template match="Order">
<OrderDet>
<i:ID>
<xsl:value-of select="@Acct"/>
</i:ID>
</OrderDet>
<i:Date>
<xsl:attribut e name="Format">
<xsl:value-of select="Instrmt/@MMY" />
</xsl:attribute>
</i:Date>
</OrderDet>
[/HTML]
I am not sure what youa re trying to do. Can you tell us a little more?
I am leaving this link with you, hope it steers you in the right direction: http://www.w3schools.com/xsl/xsl_languages.asp
In a bit!
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Paul Mateer |
last post by:
Hi,
I have been running some queries against a table in a my database and
have noted an odd (at least it seems odd to me) performance issue.
The table has approximately 5 million rows and includes the following
columns:
DocID (INTEGER, PRIMARY KEY, CLUSTERED)
IsRecord (INTEGER, NONCLUSTERED)
|
by: bc |
last post by:
Hello all,
Background:
I've posted a couple questions recently regarding using BCP to extract
many tables to text files. I've written an extract application that
bcp's about 100 tables from a database to text files. I've run into a
couple limitations using BCP, but I finally landed on (what I thought)
was a solid solution. I now call bcp passing a sproc name and a
parameter or two and having that sproc execute the query for me,
thereby...
|
by: Miranda Evans |
last post by:
I noticed several postings about issues related to "run-time error
3061", and I observed that the solutions to these issues appear to
involve correcting something within the SQL code. I'm encountering
the "run-time error 3061" issue, but I'm not sure how to go about
correcting the SQL. My hunch is that I have not properly constructed
things to identify a date field, but I don't know how to correct this
issue. In addition to not...
|
by: laurentc via AccessMonster.com |
last post by:
Hi.
I have an issue with my Access project.
I have rather big tables of data (about 11 000 rows).
These tables are historical product quotations, so they are very simple :
- MyDate (PrimaryKey)
- Quote
I do some calculations on these data:
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |