473,472 Members | 2,143 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

XSL and elements containing "xmlns"

1 New Member
I have an XML doc that looks something like this:

<?xml version="1.0" encoding="utf-8"?>
<elem1>
<elem2 xmlns="http://someurl.com">
<elem3>
<item>some stuff here</item>
<item>some more stuff here</item>
<item>even more stuff here</item>
</elem3>
</elem2>
</elem1>

my XSLT file looks like this:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="html" encoding="US-ASCII"/>

<xsl:template match="/">
<html>
<body>
<xsl:for-each select="//elem1/elem2/elem3/item">
<xsl:value-of select="."/>
</xsl:for-each>

hello world
</body>
</html>
</xsl:template>
</xsl:stylesheet>

The problem:

For some reason the for-each does not work with elem2 having an attribute named "xmlns". It only results in an HTML doc which says "hello world." If I change it the name of the attribute to something else, I can spin through quite easily. Through playing around a bit, its like it doesn't recognize elem2 when it has the "xmlns" attribute. What am I missing? The simple solution would be to modify the xml doc, but I don't control what I'm getting. I need to find a way to make it work as-is.

Thoughts?

Thanks,

Tim
Oct 18 '06 #1
0 1405

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Mike Dickens | last post by:
hi, i'm sure this has come up before but havn't managed to find an answer. if i have the following xslt <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet method="xml" version="1.0"...
3
by: Keith Hill | last post by:
I am creating an XmlDocument in code and then using XmlTextWriter via doc.WriteTo(xwriter) to output the result to a text box. I have a root element that defines a default namespace. However, the...
5
by: NeilL | last post by:
In the XML document I'm trying to create I do the following elem = _doc.CreateElement("Author"); elem.InnerText = "something"; parentElem.AppendChild(elem); Thiw works properly however the...
3
by: Jim Hsu | last post by:
when I use the XmlWebSerivce to response the xmlelement to Web Service client. the ASP.net plumbing work ( the XmlSerializer in WebServices ) will serialize the XML if we can control the wrapper...
3
by: ano | last post by:
Hi, Anyone knows how to get "xmlns" value from XML file? For example, how to check that this xml file has a xmlns or not? Or how to read the xmlns value? <bookstore...
0
by: R. Ian Lee | last post by:
I've built an XSLT file that transforms data to SpreadsheetML format. The XSLT uses a <xsl:call-template/to build each worksheet. For some reason, when I transform the file, it is inserting...
3
by: Lee | last post by:
Hello guys, I am new to XML and working on a XSLT to transforn yahoo shopping search result to html. my problem is the return XML contain xmlns in root element, here is the sample xml: <?xml...
4
by: BorisBoshond | last post by:
Hi all, Hope someone is able and willing to help me with following problem. I received a xsd file from another company, our company i supposed to return xml based on that xsd. Problem is that I...
4
markmcgookin
by: markmcgookin | last post by:
Hi, I am creating an MXL doc using XSLT but for some reason it is churning out elements like this <DateTimeLastSaved xmlns="" /> <UserName xmlns="" /> when I delete xmlns="" it works fine,...
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
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...
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,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.