473,785 Members | 2,419 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I need help in changing the XSL code


Good day,
My knowledge of XML is next to none and I only have one XSL code to use.
I also assume I may be using incorrect jargon and hope you will
understand what I need.

I have an XSL style sheet to convert the XML flat file. I need to
change the style sheet so it groups certain data together under one
heading. I need to be able to do this as the system I upload the file
to do not accept the information as presented and continuously gives me
an error. What I am trying to say is that the “result” information
under “sample” grouped together where the “sample” information is the
same.

Your assistance is much appreciated.

Thank you.

Hennie

The format it requires is as follow:

<sample sample_date_tim e="20070101" imis_cp_ext="23 00" cp_name="NEUTRA .
SUMP WTPE" dischg_sample_c d="20070101" sample_comment= "">
<result rpttime_name="D AILY" sis_imis_code=" FTFLOW" parm_name="FLOW "
result_structur e="SI" unit_abbrev="M3/D" rptas_abbrev="N OT APPL"
component_type= "SM" result_value="1 70.000000" result_comment= ""
imis_regulation _code_1="CA" imis_regulation _code_2="MC" />
<result rpttime_name="D AILY" sis_imis_code=" PH" parm_name="PH (-LOG H+
CONCN)" result_structur e="P3" unit_abbrev="NO DIM" rptas_abbrev="N OT
APPL" component_type= "V1" result_value="8 .246000" result_comment= ""
imis_regulation _code_1="MC" />
<result rpttime_name="D AILY" sis_imis_code=" PH" parm_name="PH (-LOG H+
CONCN)" result_structur e="P3" unit_abbrev="NO DIM" rptas_abbrev="N OT
APPL" component_type= "T1" result_value="0 8:00" result_comment= ""
imis_regulation _code_1="MC" />
<result rpttime_name="D AILY" sis_imis_code=" PH" parm_name="PH (-LOG H+
CONCN)" result_structur e="P3" unit_abbrev="NO DIM" rptas_abbrev="N OT
APPL" component_type= "V2" result_value="8 .233000" result_comment= ""
imis_regulation _code_1="MC" />
<result rpttime_name="D AILY" sis_imis_code=" PH" parm_name="PH (-LOG H+
CONCN)" result_structur e="P3" unit_abbrev="NO DIM" rptas_abbrev="N OT
APPL" component_type= "T2" result_value="1 2:00" result_comment= ""
imis_regulation _code_1="MC" />
<result rpttime_name="D AILY" sis_imis_code=" PH" parm_name="PH (-LOG H+
CONCN)" result_structur e="P3" unit_abbrev="NO DIM" rptas_abbrev="N OT
APPL" component_type= "V3" result_value="8 .216000" result_comment= ""
imis_regulation _code_1="MC" />
<result rpttime_name="D AILY" sis_imis_code=" PH" parm_name="PH (-LOG H+
CONCN)" result_structur e="P3" unit_abbrev="NO DIM" rptas_abbrev="N OT
APPL" component_type= "T3" result_value="1 6:00" result_comment= ""
imis_regulation _code_1="MC" />
<result rpttime_name="D AILY" sis_imis_code=" RSP"
parm_name="RESI DUE,PARTICULATE " result_structur e="SI" unit_abbrev="MG/L"
rptas_abbrev="N OT APPL" component_type= "SM" result_value="3 .38"
result_comment= "" imis_regulation _code_1="CA"
imis_regulation _code_2="MC" />
</sample>

The one generated by the XSL style sheet is as follow.: Only a few
records posted

- <sample sample_date_tim e="20070101" imis_cp_ext="23 00" cp_name="Neutr.
Sump WTPE" dischg_sample_c d="" sample_comment= "">
<result rpttime_name="D AILY" sis_imis_code=" FTFLOW" parm_name="Flow "
unit_abbrev="M3/D" rptas_abbrev="N OT APPL" result_structur e="SI"
component_type= "SM" result_value="1 68.2" remark_code_1=" "
remark_code_2=" " remark_code_3=" " result_comment= ""
imis_regulation _code_1="MC" imis_regulation _code_2="CA" />
</sample>
- <sample sample_date_tim e="20070101" imis_cp_ext="23 00" cp_name="Neutr.
Sump WTPE" dischg_sample_c d="" sample_comment= "">
<result rpttime_name="D AILY" sis_imis_code=" PH" parm_name="pH (-log H+
Concn)" unit_abbrev="NO DIM" rptas_abbrev="N OT APPL"
result_structur e="P3" component_type= "V1" result_value="8 .2"
remark_code_1=" " remark_code_2=" " remark_code_3=" " result_comment= ""
imis_regulation _code_1="MC" imis_regulation _code_2="" />
</sample>
- <sample sample_date_tim e="20070101" imis_cp_ext="23 00" cp_name="Neutr.
Sump WTPE" dischg_sample_c d="" sample_comment= "">
<result rpttime_name="D AILY" sis_imis_code=" PH" parm_name="pH (-log H+
Concn)" unit_abbrev="NO DIM" rptas_abbrev="N OT APPL"
result_structur e="P3" component_type= "T1" result_value="0 8:00"
remark_code_1=" " remark_code_2=" " remark_code_3=" " result_comment= ""
imis_regulation _code_1="MC" imis_regulation _code_2="" />
</sample>
- <sample sample_date_tim e="20070101" imis_cp_ext="23 00" cp_name="Neutr.
Sump WTPE" dischg_sample_c d="" sample_comment= "">
<result rpttime_name="D AILY" sis_imis_code=" PH" parm_name="pH (-log H+
Concn)" unit_abbrev="NO DIM" rptas_abbrev="N OT APPL"
result_structur e="P3" component_type= "V2" result_value="8 .17"
remark_code_1=" " remark_code_2=" " remark_code_3=" " result_comment= ""
imis_regulation _code_1="MC" imis_regulation _code_2="" />
</sample>
- <sample sample_date_tim e="20070101" imis_cp_ext="23 00" cp_name="Neutr.
Sump WTPE" dischg_sample_c d="" sample_comment= "">
<result rpttime_name="D AILY" sis_imis_code=" PH" parm_name="pH (-log H+
Concn)" unit_abbrev="NO DIM" rptas_abbrev="N OT APPL"
result_structur e="P3" component_type= "T2" result_value="1 2:00"
remark_code_1=" " remark_code_2=" " remark_code_3=" " result_comment= ""
imis_regulation _code_1="MC" imis_regulation _code_2="" />
</sample>
The style sheet is :
<?xml version="1.0" encoding="iso-8859-1" ?>
- <!--
sample.xsl
-->
- <xsl:styleshe et xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="xml" indent="yes" />
- <xsl:variable name="UC">
<xsl:text>ABCDE FGHIJKLMNOPQRST UVWXYZ</xsl:text>
</xsl:variable>
- <xsl:variable name="lc">
<xsl:text>abcde fghijklmnopqrst uvwxyz</xsl:text>
</xsl:variable>
- <xsl:template match="/">
- <submission imis_company_co de="0001843309 " ws_name=" ">
<xsl:apply-templates />
</submission>
</xsl:template>
- <xsl:template match="sample">
- <sample sample_date_tim e="{sample_date _time}"
imis_cp_ext="{i mis_cp_ext}" cp_name="{cp_na me}"
dischg_sample_c d="{dischg_samp le_cd}" sample_comment= "{sample_commen t}">
<result rpttime_name="{ translate(rptti me_name,$lc,$UC )}"
sis_imis_code=" {translate(sis_ imis_code,$lc,$ UC)}"
parm_name="{par m_name}" unit_abbrev="{U nit_abbrev}"
rptas_abbrev="{ rptas_abbrev}" result_structur e="{result_stru cture}"
component_type= "{component_typ e}" result_value="{ result_value}"
remark_code_1=" {remark_code_1} " remark_code_2=" {remark_code_2} "
remark_code_3=" {remark_code_2} " result_comment= "{result_commen t}"
imis_regulation _code_1="{imis_ regulation_code _1}"
imis_regulation _code_2="{imis_ regulation_code _2}" />
</sample>
</xsl:template>
</xsl:stylesheet>


*** Sent via Developersdex http://www.developersdex.com ***
May 15 '07 #1
0 1759

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

Similar topics

21
2990
by: Chris Reedy | last post by:
For everyone - Apologies for the length of this message. If you don't want to look at the long example, you can skip to the end of the message. And for the Python gurus among you, if you can spare the time, I would appreciate any comments (including words like evil and disgusting, if you think they are applicable :-}) on the example here. Kenny -
7
3300
by: Shyguy | last post by:
I have an option group with about 30 options. I would like to have the Option Labels get their text from a table. Is this possible, and if so how? Also, is it possible to embad a font into a database or does each machine need to have that font installed? Thanks for any help, ShyGuy
19
4109
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate the code that implements managing unbound controls on forms given the superior performance of unbound controls in a client/server environment. I can easily understand a newbie using bound controls or someone with a tight deadline. I guess I need...
48
3246
by: Chad Z. Hower aka Kudzu | last post by:
A few of you may recognize me from the recent posts I have made about Indy <http://www.indyproject.org/indy.html> Those of you coming to .net from the Delphi world know truly how unique and "huge" Indy is both as a project, in support, development, and use. But Indy is new to the .net world. Indy is a HUGE library implementing over 120 internet protocols and standards and comes with complete source. Its an open source project, but not...
8
2324
by: Tim Geiges | last post by:
Since I am being challenged with learning c# I figured I could pass some of the pain on to you guys :-) I have another question(this one is important for me to fix before I can get my app to Beta) My app (an image viewer) opens with a Main form with a file explorer if you open the program with the exe, but opens with the ImageView form if you double click an image file, if you want to see the Main form once the ImageView is open the...
2
1811
by: wazoo | last post by:
I'm hoping someone here might help me with this. I'm putting the finishing touches on my intranet web app, and I'm adding some simple JavaScript to my VB.Net Webforms. This works: Button1.Attributes.Add("onmouseover", "this.style.backgroundColor=""Blue""") Button1.Attributes.Add("onmouseout", "this.style.backgroundColor=""Navy""") And this works:
3
1988
by: moondaddy | last post by:
I have some text in a page that when a certain even happens, I need to make it glow from black to red (through a spand of 1 second) pause for a few seconds, and then slowly change from red to black over a span of 1 second again. Lastly, this needs to be compatible with NS 4 if possible, or if not possible, then at least so NS4 doesnt crash or get errors. This is to flag a user that something has happened. Thanks.
15
3914
by: phillip.s.powell | last post by:
<style> div div table tr td a.navbar, div div table tr td font {display: none;} </style> <div class="navigationbar" style="background-color:Black; position: absolute; left:50%; top:127px; margin-left: -400px; width: 800px; height: 26px"> <!-- CODE GOES HERE --> </div>
20
1483
by: d.s. | last post by:
I've got an app with two classes, and one class (InventoryInfoClass) is an object within the other class (InventoryItem). I'm running into problems with trying to access (get/set) a private variable within the included class (InventoryInfo) from the "including" class (InventoryItem). Here's the code, trimmed down. I've included ********* at the start of the first line that's blowing up on me. I'm sure others that try to access the...
3
2025
by: akshaycjoshi | last post by:
IT"S A LONG QUESTION.PLEASE BE PATIENT TO READ IT. I HAVE EXPLAINED IT TO MY MAXIMUM CAPACITY. I am making one app. in which i need to create a seperate access database for each day. Its a call charging software which monitors the calls made by extensions (just like the hotel rooms). Now there is GUI, in which there is richtextbox, a treview, and a menustrip. The treeview shows information about the all the extensions and others.
0
9645
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10148
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10091
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8972
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6740
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.