473,396 Members | 2,011 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

adding multiple name spaces

Dear All,

I need some help on an XLST. I need to create an XML output from some
xml document by XSLT. The top element must contain multiple name
spaces.

I tried this as an example:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8"
indent="yes"/>
<xsl:template match="/">
<xsl:element name="E1" namespace="urn:ns1name">
<xsl:attribute name="ns2name"
namespace="xmlns">urn:ns2</xsl:attribute>
<xsl:attribute name="ns3name"
namespace="xmlns">urn:ns3</xsl:attribute>
</xsl:element>
</xsl:template>
</xsl:stylesheet>

The output (created by ALTOVA XMLSPY with MSXML 4 ) looks like this

<?xml version="1.0" encoding="UTF-8"?>
<E1 auto-ns1:ns2name="urn:ns2" auto-ns1:ns3name="urn:ns3"
xmlns:auto-ns1="xmlns" xmlns="urn:ns1name" />

I expected this:
<?xml version="1.0" encoding="UTF-8"?>
<E1 xmlns="urn:ns1" xmlns:ns2name="urn:ns2" xmlns:ns3name="urn:ns3"/>

Is the output I got equivalent to what I expected ??
How can I achieve the expected output ??

Thanks a lot for your help
Rolf
Jul 20 '05 #1
1 3437
Hi Rolf,
You can write as this -

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

<xsl:template match="/">
<E1 xmlns="urn:ns1" xmlns:ns2name="urn:ns2" xmlns:ns3name="urn:ns3">
<!--anything else -->
</E1>
</xsl:template>

</xsl:stylesheet>

Regards,
Mukul

Ke*****@ee.nec.de (Rolf Kemper) wrote in message news:<bb**************************@posting.google. com>...
Dear All,

I need some help on an XLST. I need to create an XML output from some
xml document by XSLT. The top element must contain multiple name
spaces.

I tried this as an example:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8"
indent="yes"/>
<xsl:template match="/">
<xsl:element name="E1" namespace="urn:ns1name">
<xsl:attribute name="ns2name"
namespace="xmlns">urn:ns2</xsl:attribute>
<xsl:attribute name="ns3name"
namespace="xmlns">urn:ns3</xsl:attribute>
</xsl:element>
</xsl:template>
</xsl:stylesheet>

The output (created by ALTOVA XMLSPY with MSXML 4 ) looks like this

<?xml version="1.0" encoding="UTF-8"?>
<E1 auto-ns1:ns2name="urn:ns2" auto-ns1:ns3name="urn:ns3"
xmlns:auto-ns1="xmlns" xmlns="urn:ns1name" />

I expected this:
<?xml version="1.0" encoding="UTF-8"?>
<E1 xmlns="urn:ns1" xmlns:ns2name="urn:ns2" xmlns:ns3name="urn:ns3"/>

Is the output I got equivalent to what I expected ??
How can I achieve the expected output ??

Thanks a lot for your help
Rolf

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: jing_li | last post by:
Hi, you all, I am a newbee for php and I need your help. One of my coworker and I are both developing a webpage for our project using php. We have a copy of the same files in different location...
3
by: Mark | last post by:
Hi, Im trying to validate a form, all the validating works apart from one field. This particular field must consist of the first 2 characters as letters, & the following 5 as numbers. And if it...
2
by: brenda.stow | last post by:
error msg " An error occured while referencing the object. You tried to run a visual basic procedure that improperly references a property or method of an object" This msg occurs everytime I add a...
4
by: Neo Geshel | last post by:
Greetings I am using VB in my ASP.NET project that uses an admin web site to populate a database that provides content for a front end web site. I am looking for a way to use replace() to...
1
by: cemcat | last post by:
Hello, We have an ASP.NET 2.0 (C#) web form that contains a textbox for users to enter multiple e-mail addresses separated by semicolons. We need to validate that each individual e-mail address...
1
by: Vikram | last post by:
I have a label control whose text is having multile spaces "Name :" but when this is rendered as html in an aspx page it only shows single space. How to render with multiple spaces.
5
by: polturgiest | last post by:
hie all i got a form <form name="TEST" method=POST action="test.php"> <input type="text" name="MyInput"> <input type="submit" name="ACTION" value="SAVE">
3
by: bstjean | last post by:
Hi everyone, I am trying to find an efficient way to perform a special query. Let me explain what I want. Let's say we are looking for all description that match "this is the target". In...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
Oralloy
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,...
0
tracyyun
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.