473,465 Members | 1,962 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

XSLT & The Noob........

4 New Member
Folks -

I have a stylesheet difficulty that I'm sure most of you could probably solve in moments - this thing has had me stymied for parts of several days......I've attached the stylesheet and some sample data.

The stylesheet is by no means pretty, but it's supposed to output HTML for the body of an email. There are Header and OrderResponseBody children to the OrderResponse parent(CIDX). The problem is that I need to pull a date out of the XML in the Header nodeset while processing the OrderResponseBody nodeset. The closest I've been able to come to suceeding is by using 'following-sibling' although what I really need is something like a 'following-sibling-or-self'.

The stylesheet has some comments, I'm dealing with 'Date Acknowledged' and no amount of blood, sweat and tears has helped me find a solution to this particular problem! I had posted on another forum but I guess they're all on vacation!

Thanks For Helping Out!

Bob
Attached Files
File Type: zip FertXML.zip (2.9 KB, 81 views)
Apr 23 '09 #1
6 1841
Dormilich
8,658 Recognized Expert Moderator Expert
I see only one date in the header section so you can access that (more or less) directly.
you can also "save" the date in <xsl:variable> for later usage.
Apr 23 '09 #2
BobSSC
4 New Member
Hi Dormilich -

The CIDX standard allows for 2 date fields in the Header:
Header 1..1
ThisDocumentIdentifier 1..1
ThisDocumentDateTime 1..1
RequestingDocumentIdentifier 0..1
RequestingDocumentDateTime 0..1
From 1..1
To 1..1

I need both anyway.

The stylesheet is using
<xsl:for-each select="./OrderResponseBody"> which seems to be preventing me from puilling in the date/time elements from the header.

I've tried selecting Header/RequestingDocumentDateTime/DateTime/text()) and that returns nothing. I've also tried preceeding-sibling and that returns the same date for all 3 orders in the sample data. As you can see from the XSLT, I'm stuck using version 1.0 and I'm forced to use a really ugly conversion from 'Zulu' time as well. So far, the only thing that has gotten me even close is the following-sibling currently in the XSLT but that returns 2 of the 3 dates.

Bob
Apr 23 '09 #3
Dormilich
8,658 Recognized Expert Moderator Expert
is there any clear identification which header belongs to which body, except that the header precedes the body in the xml?
Apr 23 '09 #4
BobSSC
4 New Member
None whatsoever - this is strictly a matter of order/precedence:

Header
ResponseBody
Header
ResponseBody
Header
ResponseBody
Apr 23 '09 #5
jkmyoung
2,057 Recognized Expert Top Contributor
preceding-sibling::Header[1]/restofxpath...

?
Apr 24 '09 #6
BobSSC
4 New Member
Thanks JKM -
I got it working this afternoon by changing the XSLT to instantiate based on Header and changing the pathing to select following sibling nodes. I do appreciate the help!

Bob
Apr 24 '09 #7

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

Similar topics

3
by: J Trost | last post by:
I was wondering if anyone knows if it is possible to do basic string replacement using XSLT even though the strings being replaced may contain "<" and ">". Here is my problem: I need to be able...
3
by: Jack Fox | last post by:
I've never had the need to work with XML, but I believe I now have an appropriate application. I have time-series data in objects organized as a tree that I want an ASP.NET program to write out to...
2
by: chris | last post by:
Hi there, I create an XML file from a dataset like this: System.IO.StreamWriter xmlSW = new System.IO.StreamWriter(FILENAME); dsUserData1.WriteXml(xmlSW, XmlWriteMode.WriteSchema);...
3
by: crc128 | last post by:
Hi, I'm looking at using XML and XSLT with apache cocoon to automatically generate html files for a site. the problem I'm having is that I want one of the pages to display a google map, but the...
2
by: daz_oldham | last post by:
Hi All I am re-visiting XSLT after not touching it for about three years, so to be honest I am starting myself from scratch. If I have XML under the namespace "http://tempuri.com/abc/2002/09",...
0
by: DAnne | last post by:
Hi, I'm very new to xslt and this is my first time posting to a Forum so please forgive me if I transgress any protocols. I have to do a tally report. This report is divided up into sections....
4
by: =?Utf-8?B?dmlua2k=?= | last post by:
I just want to pass the below URL in my xslt file. <a href="http://testwebi/testlite/admin/remoteMgmt.aspx?id=<xsl:value-of select="indexID"/>&action=1"> i keep geeting errors whn i am trying...
3
by: realmerl | last post by:
Hi All. I'm trying to transform a html document into plain text via xslt. Simple you say! (i hope) I have got it working, by using the magnificent <xsl:value-of select="."/>. This returns the...
4
by: mark4asp | last post by:
I have an element, report which contains tags which have been transformed. E.g. <pis &lt;p&gt <myXml> <report>This text has html tags in it.&lt;p&gt which but <has been changed to &lt;&gt</report>...
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,...
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...
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: 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?

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.