473,405 Members | 2,379 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,405 software developers and data experts.

Another prefix problem


I'm not sure how to address nodes with prefixes when doing a select.
----------------------------------------------------------
<System xmlns="" name="SAP_R3_Financials_DEV200">
<Attributes xmlns="">
<pcd:Attribute name="ApplicationServer" value="secacsap"/>
<pcd:Attribute name="ServerPort" value="3200"/>
</Attributes>
</System>
----------------------------------------------------------
the xsl looks like this:
----------------------------------------------------------
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:pcd="www.sapportals.com/portal/" version="1.0">
<xsl:output method="text"/>

<xsl:template match="text()">
<xsl:value-of select="normalize-space(.)"/>
</xsl:template>

<xsl:template match="System">
<xsl:value-of select="normalize-space(@name)"/>,<xsl:apply-templates
select="Attributes/pcd:Attribute"/>,
</xsl:template>

<xsl:template match="Attribute">
<xsl:value-of select="@name"/>
</xsl:template>

</xsl:stylesheet>
------------------------------------------------------------
Although no errors are reported, I dont see any of the "Attribute" output.

Is the "<xsl:apply-templates select="Attributes/pcd:Attribute"/>" the
correct way of addressing it? I've trieb Attributes/Attributes also and it
doesn't work either.
Regards

Jul 20 '05 #1
3 1136
Jacques wrote:
I'm not sure how to address nodes with prefixes when doing a select.
----------------------------------------------------------
<System xmlns="" name="SAP_R3_Financials_DEV200">
<Attributes xmlns="">
<pcd:Attribute name="ApplicationServer" value="secacsap"/>
<pcd:Attribute name="ServerPort" value="3200"/>
</Attributes>
</System>
----------------------------------------------------------
the xsl looks like this:
----------------------------------------------------------
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:pcd="www.sapportals.com/portal/" version="1.0">
<xsl:output method="text"/>

<xsl:template match="text()">
<xsl:value-of select="normalize-space(.)"/>
</xsl:template>

<xsl:template match="System">
<xsl:value-of select="normalize-space(@name)"/>,<xsl:apply-templates
select="Attributes/pcd:Attribute"/>,
</xsl:template>

<xsl:template match="Attribute">
<xsl:value-of select="@name"/>
</xsl:template>
the right element is pcd:Attribute

<xsl:template match="pcd:Attribute">
<xsl:value-of select="@name"/>
</xsl:template>


</xsl:stylesheet>
------------------------------------------------------------
Although no errors are reported, I dont see any of the "Attribute" output.

Is the "<xsl:apply-templates select="Attributes/pcd:Attribute"/>" the
correct way of addressing it? I've trieb Attributes/Attributes also and it
doesn't work either.
Regards

--
Cordialement,

///
(. .)
-----ooO--(_)--Ooo-----
| Philippe Poulard |
-----------------------
Jul 20 '05 #2
Once again you helped a beginner on the right path,

thanks
Regards

"Philippe Poulard" <Ph****************@SPAMsophia.inria.fr> wrote in message
news:cb**********@news-sop.inria.fr...
Jacques wrote:
I'm not sure how to address nodes with prefixes when doing a select.
----------------------------------------------------------
<System xmlns="" name="SAP_R3_Financials_DEV200">
<Attributes xmlns="">
<pcd:Attribute name="ApplicationServer" value="secacsap"/>
<pcd:Attribute name="ServerPort" value="3200"/>
</Attributes>
</System>
----------------------------------------------------------
the xsl looks like this:
----------------------------------------------------------
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:pcd="www.sapportals.com/portal/" version="1.0">
<xsl:output method="text"/>

<xsl:template match="text()">
<xsl:value-of select="normalize-space(.)"/>
</xsl:template>

<xsl:template match="System">
<xsl:value-of select="normalize-space(@name)"/>,<xsl:apply-templates
select="Attributes/pcd:Attribute"/>,
</xsl:template>

<xsl:template match="Attribute">
<xsl:value-of select="@name"/>
</xsl:template>


the right element is pcd:Attribute

<xsl:template match="pcd:Attribute">
<xsl:value-of select="@name"/>
</xsl:template>


</xsl:stylesheet>
------------------------------------------------------------
Although no errors are reported, I dont see any of the "Attribute" output.
Is the "<xsl:apply-templates select="Attributes/pcd:Attribute"/>" the
correct way of addressing it? I've trieb Attributes/Attributes also and it doesn't work either.
Regards

--
Cordialement,

///
(. .)
-----ooO--(_)--Ooo-----
| Philippe Poulard |
-----------------------

Jul 20 '05 #3
Jacques wrote:
Once again you helped a beginner on the right path,


tadaaa !

mission accomplished !

--
Cordialement,

///
(. .)
-----ooO--(_)--Ooo-----
| Philippe Poulard |
-----------------------
Jul 20 '05 #4

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

Similar topics

5
by: Paul Lamonby | last post by:
Hi, i want to create a unique serial number to my Db entries. I thought the best way would be to add the auto_increment primary key value to a string, then insert it into a table field...
6
by: John R | last post by:
Hi all, I'm trying to get my VB6 app to look up prefixes for a phone number out of an MDB file along with an associated price etc. For example the phone number could be 9802xxxx, and the MDB...
6
by: nico | last post by:
In my python scripts, I use a lot of accented characters as I work in french. In order to do this, I put the line # -*- coding: UTF-8 -*- at the beginning of the script file. Then, when I need...
1
by: Romeo Disca | last post by:
Hello newsgroup, i'm new to xml - what's wrong with this piece code here? i have these two files: test.xml ---- <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE a SYSTEM "test.ent"
3
by: Jacques | last post by:
I'm experiencing the following problem The source xml file uses a prefix (wpl:) and look like this (shortened): ----------------------------------------------------------------- <?xml...
4
by: jb | last post by:
I have discovered that when the WSDL is auto-generated in .NET (i.e. http://.../MyService.asmx?WSDL): * Prior to SP1, it generated xmlns:s0="http://mynamespace/" in <wsdl:definitions>, and then...
6
by: HappyHippy | last post by:
More of a minor niggle than anything but how would I remove the aforementioned space? eg. strName = 'World' print 'Hello', strName, ', how are you today?' comes out as "Hello World , how are...
11
by: cjt22 | last post by:
Hi startswith( prefix]) States: Return True if string starts with the prefix, otherwise return False. prefix can also be a tuple of suffixes to look for. However when I try and add a tuple...
2
by: Simon Brooke | last post by:
I have a document type which I'm developing and working with, which is currently defined in a DTD, mainly because I still haven't really learned to use schemas. In this document type I need to...
0
by: Tim Golden | last post by:
aditya shukla wrote: Why on earth are you *specifying* c:\python25 as the directory for this file? It's automatically created in your user-specific temp directory which has specific permissions...
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...
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
jinu1996
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...
0
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...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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.