Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > non-prefixed xmlns attribute

Reply
Thread Tools

non-prefixed xmlns attribute

 
 
Michael TEpperis
Guest
Posts: n/a
 
      05-17-2004
hello,

my xml files starts with

+++++++
<?xml version='1.0' encoding='utf-8' ?>
<?integrity app='Visio' version='10.0' buildnum='525' metric='1'
key='004FEC3B329899673AA9E1A9C449A33530032E8409CF4 68FD94A9ED64401BE57D3481031BF2985FFCA9289E12A566C4 F6ACCEAC545D0A4495E4BCEB25B859ED4'
keystart='261' ?>

<VisioDocument xmlns='urn:schemas-microsoft-comffice:visio'>
<DocumentProperties>
....

++++++++

with the following xslt rule I don't have results:

<xsl:apply-templates select = "//DocumentProperties"/>

but if I erase the xmlns attribute, I succeed.

why?

tia

Michael Tepperis-von der Ohe
logicacmg - germany
 
Reply With Quote
 
 
 
 
Richard Tobin
Guest
Posts: n/a
 
      05-17-2004
In article <(E-Mail Removed) >,
Michael TEpperis <(E-Mail Removed)> wrote:

><VisioDocument xmlns='urn:schemas-microsoft-comffice:visio'>
><DocumentProperties>


The name of this element is DocumentProperties in the namespace
urn:schemas-microsoft-comffice:visio.

> <xsl:apply-templates select = "//DocumentProperties"/>


This matches elements called DocumentProperties in no namespace.

To match elements in the namespace urn:schemas-microsoft-comffice:visio,
you need to declare a prefix for it in the stylesheet and use that prefix:

<xsl:apply-templates xmlns:z="urn:schemas-microsoft-comffice:visio"
select = "//zocumentProperties"/>

If you're going to use the prefix in other places too, declare it on the
stylesheet element.

-- Richard
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What does xmlns:xsi and xmlns:xsd attributes mean? afshar XML 3 05-19-2010 02:16 AM
Need to remove blank XMLNS attribute from xmldocument =?Utf-8?B?RXdhbiBGYWlyd2VhdGhlcg==?= ASP .Net 0 04-14-2006 06:06 PM
Unrecognized attribute 'xmlns'. kai ASP .Net 7 11-21-2005 01:25 AM
xmlns:SOAP-ENC, xmlns:xsd required? chris.stromberger@gmail.com XML 0 10-26-2005 02:48 PM
Unrecognized attribute 'xmlns'. john1001 ASP .Net 6 10-15-2005 12:32 PM



Advertisments