473,472 Members | 1,761 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

XSLT generates values, but not tags

I have an XSL that was auto-generated by mapping two XML Schema XSD's.
When I run the transformation, I get the values output to the console,
but none of the appropriate tags are appearing... Here are the files:

XML:

<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSPY v2004 rel. 3 U (http://www.xmlspy.com) by
Aerosystems International Inc (Aerosystems International Inc) -->
<!--Sample XML file generated by XMLSPY v2004 rel. 3 U
(http://www.xmlspy.com)-->
<WorkOrder xmlns="http://xmlns.web.boeing.com/Aerospace_Support/SDS/"
xmlns:oa="http://www.openapplications.org/oagis"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.web.boeing.com/Aerospace_Support/SDS/
...\Resources\Nouns\WorkOrder.xsd">
<WorkOrderDetails>
<Uid>String</Uid>
<ExternalId>String</ExternalId>
<Type>Manual</Type>
<Name>APU clutch warped</Name>
<Description>APU clutch warped</Description>
<WorkDone>String</WorkDone>
<Position>15B05 00</Position>
<Claim>
<ChildUid>String</ChildUid>
</Claim>

<Status>Accepted</Status>
<Code>15B01-1</Code>
<FaultClassification>701</FaultClassification>
<DelayCode>String</DelayCode>
<HowWhenDiscovered>1</HowWhenDiscovered>
<MalfunctionEffect>5</MalfunctionEffect>
<TaskDetails>
<TaskCode>15B01-1</TaskCode>
<Name>Remove APU</Name>
<Position>15B</Position>
<Status>Pending</Status>
<TradeBookingRecord>
<TradeType>String</TradeType>
<TradeSkill>String</TradeSkill>
<OperativeHours>3.14159</OperativeHours>
<SupervisorHours>3.14159</SupervisorHours>
<SelfSupervized>1</SelfSupervized>
</TradeBookingRecord>
</TaskDetails>
<TaskDetails>
<TaskCode>15B01-2</TaskCode>
<Name>Replace APU</Name>
<Position>15B</Position>
<Status>Pending</Status>
<TradeBookingRecord>
<TradeType>String</TradeType>
<TradeSkill>String</TradeSkill>
<OperativeHours>3.14159</OperativeHours>
<SupervisorHours>3.14159</SupervisorHours>
<SelfSupervized>1</SelfSupervized>
</TradeBookingRecord>
</TaskDetails>
</WorkOrderDetails>
</WorkOrder>

XSL:

<?xml version="1.0" encoding="UTF-8"?>
<!--
This file was generated by Altova MapForce 2005

YOU SHOULD NOT MODIFY THIS FILE, BECAUSE IT WILL BE
OVERWRITTEN WHEN YOU RE-RUN CODE GENERATION.

Refer to the Altova MapForce 2005 Documentation for further details.
http://www.altova.com/mapforce
-->
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:oa="http://www.openapplications.org/oagis"
xmlns:sds="http://xmlns.web.boeing.com/Aerospace_Support/SDS"
xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
exclude-result-prefixes="xs fn">
<xsl:output method="xml" encoding="UTF-8" indent="yes"/>
<xsl:template match="WorkOrder">
<sds:WorkOrder>

<xsl:for-each select="Details">
<sds:WorkOrderDetails>
<xsl:for-each select="Uid">
<sds:Uid>
<xsl:value-of select="."/>
</sds:Uid>
</xsl:for-each>
<xsl:for-each select="ExternalId">
<sds:ExternalId>
<xsl:value-of select="."/>
</sds:ExternalId>
</xsl:for-each>
<xsl:for-each select="WorkOrderType">
<sds:Type>
<xsl:value-of select="."/>
</sds:Type>
</xsl:for-each>
<xsl:for-each select="Name">
<sds:Name>
<xsl:value-of select="."/>
</sds:Name>
</xsl:for-each>
<xsl:for-each select="Description">
<sds:Description>
<xsl:value-of select="."/>
</sds:Description>
</xsl:for-each>
<xsl:for-each select="WorkDone">
<sds:WorkDone>
<xsl:value-of select="."/>
</sds:WorkDone>
</xsl:for-each>
<xsl:for-each select="Position">
<sds:Position>
<xsl:value-of select="."/>
</sds:Position>
</xsl:for-each>
<xsl:for-each select="Claim">
<sds:Claim>
<xsl:for-each select="ChildExternalId">
<sds:ChildExternalId>
<xsl:value-of select="."/>
</sds:ChildExternalId>
</xsl:for-each>
<xsl:for-each select="ChildUid">
<sds:ChildUid>
<xsl:value-of select="."/>
</sds:ChildUid>
</xsl:for-each>
</sds:Claim>
</xsl:for-each>
<xsl:for-each select="WorkOrderStatus">
<sds:Status>
<xsl:value-of select="."/>
</sds:Status>
</xsl:for-each>
<xsl:for-each select="Code">
<sds:Code>
<xsl:value-of select="."/>
</sds:Code>
</xsl:for-each>
<xsl:for-each select="FaultClassification">
<sds:FaultClassification>
<xsl:value-of select="."/>
</sds:FaultClassification>
</xsl:for-each>
<xsl:for-each select="DelayCode">
<sds:DelayCode>
<xsl:value-of select="."/>
</sds:DelayCode>
</xsl:for-each>
<xsl:for-each select="HowWhenDiscovered">
<sds:HowWhenDiscovered>
<xsl:value-of select="."/>
</sds:HowWhenDiscovered>
</xsl:for-each>
<xsl:for-each select="MalfunctionEffect">
<sds:MalfunctionEffect>
<xsl:value-of select="."/>
</sds:MalfunctionEffect>
</xsl:for-each>
<xsl:for-each select="TaskDetails">
<sds:TaskDetails>
<xsl:for-each select="TaskCode">
<sds:TaskCode>
<xsl:value-of select="."/>
</sds:TaskCode>
</xsl:for-each>
<xsl:for-each select="Name">
<sds:Name>
<xsl:value-of select="."/>
</sds:Name>
</xsl:for-each>
<xsl:for-each select="Position">
<sds:Position>
<xsl:value-of select="."/>
</sds:Position>
</xsl:for-each>
<xsl:for-each select="TaskStatus">
<sds:Status>
<xsl:value-of select="."/>
</sds:Status>
</xsl:for-each>
<xsl:for-each select="TradeBookingRecord">
<sds:TradeBookingRecord>
<xsl:for-each select="TradeType">
<sds:TradeType>
<xsl:value-of select="."/>
</sds:TradeType>
</xsl:for-each>
<xsl:for-each select="TradeSkill">
<sds:TradeSkill>
<xsl:value-of select="."/>
</sds:TradeSkill>
</xsl:for-each>
<xsl:for-each select="OperativeHours">
<sds:OperativeHours>
<xsl:value-of select="."/>
</sds:OperativeHours>
</xsl:for-each>
<xsl:for-each select="SupervisorHours">
<sds:SupervisorHours>
<xsl:value-of select="."/>
</sds:SupervisorHours>
</xsl:for-each>
<xsl:for-each select="SelfSupervized">
<sds:SelfSupervized>
<xsl:value-of select="."/>
</sds:SelfSupervized>
</xsl:for-each>
</sds:TradeBookingRecord>
</xsl:for-each>
</sds:TaskDetails>
</xsl:for-each>
</sds:WorkOrderDetails>
</xsl:for-each>
</sds:WorkOrder>
</xsl:template>
</xsl:stylesheet>
OUTPUT:

<?xml version="1.0" encoding="UTF-8"?>

String
String
Manual
APU clutch warped
APU clutch warped
String
15B05 00

String
Accepted
15B01-1
701
String
1
5

15B01-1
Remove APU
15B
Pending

String
String
3.14159
3.14159
1

15B01-2
Replace APU
15B
Pending

String
String
3.14159
3.14159
1

Thanks!

Raj

Jul 20 '05 #1
1 1161

Your stylesheet only has one template, and that doesn't match your
input, so you just get the result of the default templates, which
copies text nodes but not element nodes.

<xsl:template match="WorkOrder">

matches WorkOrder in no namespace but you have

WorkOrder in namespace
http://xmlns.web.boeing.com/Aerospace_Support/SDS/

You need to declare

xmlns:x="http://xmlns.web.boeing.com/Aerospace_Support/SDS/" in your
stylesheet and then use x: on all element names in the stylesheet.
or use the new xslt2 feature of changing the defaultr namespace for
xpath
default-element-namespace="http://xmlns.web.boeing.com/Aerospace_Support/SDS/"
on xsl:stylesheet.
David
Jul 20 '05 #2

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

Similar topics

1
by: Leo Kirch | last post by:
Hello XSLT gurus, i've got a rather difficult problem. Some explanations first. theres a signal oriented xml-file - the graphical represantation looks like: | startsignal (signal00) \...
4
by: cyclops | last post by:
I'm trying to do XML + XSLT -> Another XML. The source XML contains multiple namespaces and XSLT will handle all possible tags under each name space. ----source---- <document xmlns="..."...
6
by: utterberg | last post by:
Hi, I've got an xml that looks like this: <section name="Risk"> <label>RISK MANAGEMENT (RM)</label> <field name="RM.1"> <ref>RM.1</ref> <label>Text goes here...</label> <option...
6
by: Mike P | last post by:
I am quite new to XML and XSLT, and I know you can apply XSLT to XML to display data in an XML file according to the XSLT file, but is it possible to apply an XSLT file to page/s of HTML, so that...
5
by: cybernerdsx2 | last post by:
Hi, I am new to XSLT and I would like to use Java to read up the XSLT content and add in a few tags in into the template below: <xsl:template name="hwSpecs"> <!-- adding new tags into here...
5
by: Praveen Mohanan | last post by:
Hi...All, I am new to XSLT. I have a XML file which need to be converted to another XML file for the client. I am using a XSLT . File 1 ------ <client name="abc" address="..." city="..."...
1
by: Sergey Dubinets | last post by:
In effort to prioritize our goals we composed the list of random features each of them may add value to set of XSLT tools offered from Microsoft. 1. XSLTc (Compiler for XSLT...
5
by: Gilgamesh | last post by:
Hi. I'm looking for an easy way to generate, automatically, an XSLT from an XSD, to be applied to a XML file (conforming the previous XSD) and generate an HTML. Many of you will tell me that...
11
by: =?ISO-8859-1?Q?Jean=2DFran=E7ois_Michaud?= | last post by:
Context: I'm trying to compare XML tree fragments and I'm doing so by outputting the attributes of each element in the tree and outputting it to a string then normalizing the strings. Then I'm...
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
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...
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: 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 ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.