473,468 Members | 1,349 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Value-of Select

Hi there,

Im in a pickle chaps. I need to fetch information out from our raw XML
files into a Style XSL sheet.

Basically I have the commant

<xsl:value-of select="Product/ProductCode"/>

However the structure of the XML file is based like the following example

<root>
<Product>
<ProductCode type="Seller">V1145</ProductCode>
<ProductCode type="Buyer">H05439</ProductCode>
</Product>
</root>

As you can see, we have different product codes based on Buyer and Sellers.
However in my style sheet I only want to see results from the Type="Seller".
This works to some degree, but if the XML file does not contain a Seller
code, the output automatically comes from the Buyer Code.

If I try to modify my value-of select statement to include "type="Seller""
then the style sheet will fail due to syntax etc.

Any help please.

Thanks
Paul
Nov 12 '05 #1
2 1858
Hi Paul,

Do you want something like?...

<xsl:value-of select="Product/ProductCode[@type = 'Seller']"/>

HTH
Marrow
http://www.marrowsoft.com - home of Xselerator (XSLT IDE and debugger)
http://www.topxml.com/Xselerator

"Paul King" <ki******@hotmail.com> wrote in message
news:41**********************@news.zen.co.uk...
Hi there,

Im in a pickle chaps. I need to fetch information out from our raw XML
files into a Style XSL sheet.

Basically I have the commant

<xsl:value-of select="Product/ProductCode"/>

However the structure of the XML file is based like the following example

<root>
<Product>
<ProductCode type="Seller">V1145</ProductCode>
<ProductCode type="Buyer">H05439</ProductCode>
</Product>
</root>

As you can see, we have different product codes based on Buyer and Sellers. However in my style sheet I only want to see results from the Type="Seller". This works to some degree, but if the XML file does not contain a Seller
code, the output automatically comes from the Buyer Code.

If I try to modify my value-of select statement to include "type="Seller""
then the style sheet will fail due to syntax etc.

Any help please.

Thanks
Paul

Nov 12 '05 #2
Yep - got it thanks matey

:)
"Marrow" <m-**********@m-a-r-r-o-w--s-o-f-t.com> wrote in message
news:#D**************@TK2MSFTNGP15.phx.gbl...
Hi Paul,

Do you want something like?...

<xsl:value-of select="Product/ProductCode[@type = 'Seller']"/>

HTH
Marrow
http://www.marrowsoft.com - home of Xselerator (XSLT IDE and debugger)
http://www.topxml.com/Xselerator

"Paul King" <ki******@hotmail.com> wrote in message
news:41**********************@news.zen.co.uk...
Hi there,

Im in a pickle chaps. I need to fetch information out from our raw XML
files into a Style XSL sheet.

Basically I have the commant

<xsl:value-of select="Product/ProductCode"/>

However the structure of the XML file is based like the following example
<root>
<Product>
<ProductCode type="Seller">V1145</ProductCode>
<ProductCode type="Buyer">H05439</ProductCode>
</Product>
</root>

As you can see, we have different product codes based on Buyer and

Sellers.
However in my style sheet I only want to see results from the

Type="Seller".
This works to some degree, but if the XML file does not contain a Seller
code, the output automatically comes from the Buyer Code.

If I try to modify my value-of select statement to include "type="Seller"" then the style sheet will fail due to syntax etc.

Any help please.

Thanks
Paul


Nov 12 '05 #3

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

Similar topics

6
by: AC | last post by:
This code works great the first few times it is used in a form and then I get the error: 'QUANTITY.value' is null or not an object in IE6. The names used are generated on the server so it is not...
8
by: AC | last post by:
I hope someone can tell me why this is not working. I have a form that dynamically creates the code below. This is for one product and there are about 10 to 50 products that are listed depending...
6
by: Steve Neill | last post by:
Here's an intersting problem... I have a JS object that has a property: "fullname"... myObject.client.name.fullname = "John Smith"; I also have a corresponding DOM element with an "id" value...
5
by: drdave | last post by:
Hi, I have 6 forms being generated using coldFusion, they are named special1, special2 special3 and so on.. in these forms I have a link to open a new window. I am trying to pickup the...
2
by: Ryan Liu | last post by:
Hi, What is the best practise to sove this problem: property with defalut value will not be called in auto-generated code ? for example
2
by: Pugi! | last post by:
hi, I am using this code for checking wether a value (form input) is an integer and wether it is smaller than a given maximum and greater then a given minimum value: function...
1
by: nudayasankar | last post by:
Hi all, I need to convert an XML using XSLT transformation. I want to call a template (with-param) in a loop. Intially I can call it with a default value. That template returns a value which should...
3
by: whitey | last post by:
this code is producing the message BUT it is entering the data. What should i do? <?php if (!$_POST) { //haven't seen the form, so show it $display_block = " <form...
1
by: kirtangl | last post by:
Hi I am kinda a noob when it comes to coding, but I have been doing some html, javascript etc. I'm creating a stopwatch (using a code I found and edited a little bit) But I need to make one...
13
by: Josip | last post by:
I'm trying to limit a value stored by object (either int or float): class Limited(object): def __init__(self, value, min, max): self.min, self.max = min, max self.n = value def...
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
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
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,...
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: 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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.