473,799 Members | 3,006 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Stumped Transforming DSML Data With XSLT`

I'm using the BIE workflow engine and after querying an LDAP DSA I need
to transform the XML response, which looks like -

<?xml version="1.0" encoding="UTF-8" ?>
<batchRespons e xmlns="urn:oasi s:names:tc:DSML :2:0:core"
xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance">
<searchRespon se requestID="9">
<searchResultEn try dn="cn=Larry Simmons,ou=Peop le,o=Morrison
Industries,c=US " requestID="9">
attr name="morrisons erialid">
<value>1015</value>
</attr>
<attr name="birthDate ">
<value>02/17/1948</value>
</attr>
<attr name="cn">
<value>Larry Simmons</value>
</attr>
<attr name="employeeN umber">
<value>KZO004 </value>
</attr>
</searchResultEnt ry>
.....
<searchResultDo ne requestID="9">
<resultCode code="0" descr="Success" />
</searchResultDon e>
</searchResponse>
</batchResponse>

Into something like -
<result>
<row>
<cn>...</cn>
<birthdate>.. .</birthdate>
....
</row>
....
</result>

So I have an xslt like
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:styleshe et version="1.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<result>
<xsl:for-each
select="batchRe sponse/searchResponse/searchResultEnt ry">
<xsl:sort select="morriso nserialid"/>
<row>
<cn><xsl:valu e-of select="attr[@name='cn']/value"/></cn>
<birthdate><xsl :value-of
select="attr[@name='birthday ']/value"/></birthdate>
<morrisonserial id><xsl:value-of
select="attr[@name='morrison serialid']/value"/></morrisonseriali d>
<fileAs><xsl:va lue-of
select="attr[@name='fileAs']/value"/></fileAs>
<startDate><xsl :value-of
select="attr[@name='morrison positionstartda te']/value"/></startDate>
</row>
</xsl:for-each>
</result>
</xsl:template>
</xsl:stylesheet>

Only when I -
xsltproc /var/spool/bie/xslt/dsaEmployeeExpo rt.2.xslt /tmp/ldapData.xml
- all I get is -
<?xml version="1.0"?>
<result/>

Huh?

Jul 20 '05 #1
2 2886
Tempore 20:02:40, die Tuesday 01 February 2005 AD, hinc in foro {comp.text.xml} scripsit <aw******@white mice.org>:
Only when I -
xsltproc /var/spool/bie/xslt/dsaEmployeeExpo rt.2.xslt /tmp/ldapData.xml
- all I get is -
<?xml version="1.0"?>
<result/>

Huh?

Hi,

It is a namespacing issue.
Include the namespace of the XML document in the XSLT
e.g.
<xsl:styleshe et xmlns:xsl="http ://www.w3.org/1999/XSL/Transform" version="1.0" exclude-result-prefixes="in" xmlns:in="urn:o asis:names:tc:D SML:2:0:core">

<xsl:template match="/">
<result>
<xsl:for-each
select="in:batc hResponse/in:searchRespon se/in:searchResult Entry">
<xsl:sort select="in:morr isonserialid"/>
<row>
<cn><xsl:valu e-of select="in:attr[@name='cn']/in:value"/></cn>
<birthdate><xsl :value-of
select="in:attr[@name='birthday ']/in:value"/></birthdate>
<morrisonserial id><xsl:value-of
select="in:attr[@name='morrison serialid']/in:value"/></morrisonseriali d>
<fileAs><xsl:va lue-of
select="in:attr[@name='fileAs']/in:value"/></fileAs>
<startDate><xsl :value-of
select="in:attr[@name='morrison positionstartda te']/in:value"/></startDate>
</row>
</xsl:for-each>
</result>
</xsl:template>

regards,
--
Joris Gillis (http://www.ticalc.org/cgi-bin/acct-v...i?userid=38041)
Veni, vidi, wiki (http://www.wikipedia.org)
Jul 20 '05 #2

this is a FAQ,

<batchRespons e xmlns="urn:oasi s:names:tc:DSML :2:0:core"

an element with name consisting of local name batchResponse and
Namespace URI urn:....
<xsl:for-each
select="batchRe sponse/searchResponse/searchResultEnt ry">

this is selecting batchResponse and searchResponse in no-namespace.
which selects nothing in your document.

add

xmlns:D="urn:oa sis:names:tc:DS ML:2:0:core"
to xsl:stylesheet then use

<xsl:for-each
select="D:batch Response/D:searchRespons e/D:searchResultE ntry">

and similarly prefix all other references to this namespace.

David
Jul 20 '05 #3

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

Similar topics

5
2179
by: Jody Greening | last post by:
Transforming with XSLT, Grouping elements until difference found. I am seeking some help with the following problem, I am fairly new at XSLT transformations, and my problem may lie in looking at it from a traditional programming point of view. I have did quite a bit of searching but have found no answers to my particular problem... please read below XML for the problem I am having.
4
3349
by: mikeyjudkins | last post by:
I have an XML file containing localized strings in 9 languages, encoded in Unicode (UTF-8). Im trying to parse this XML document via XSLT (Apache Xalan) to selectively render localized strings depending on a users selected language. The problem Im running into is that when the XML document is sent through the XSLT stylesheet, all European special characters (such as umlauts, accents, etc) are converted to html character entities (as...
3
4878
by: Sergio Otoya | last post by:
Hi all, I need to transform an xml document, using xsl to a HTML output. I can do this successfully using the XslTransform class as below: Dim oTrans As New XslTransform oTrans.Load(sXSLPath) oTrans.Transform(sXMLPath, "c:\trans.htm")
5
4506
by: Jiho Han | last post by:
I do a transform of an xml document into another xml using XslTransform. In my xsl file, I specify using <xsl:output encoding="utf-8"/>. However, when my transform is done, the resulting xml is in utf-16. What gives? Anyone?
4
2028
by: Cathie | last post by:
Hi All, I am trying to get my style sheet to work. It works fine in IE but I can't get it to work in .net. Below is the function I use for transforming, where advancedOptionsFile is the path to the file containing an XML document required by the transformation, and xmlSimplified is the XML document to trasform. ---------------------------------------------------------------------------- -------------------------------
1
1170
by: VINITAG | last post by:
<LineItem>pediatric information <NumberedList> <NumberedListItem>dgc</NumberedListItem> <NumberedListItem>djb</NumberedListItem> <NumberedListItem>jbv</NumberedListItem> <NumberedListItem>fnjfvh</NumberedListItem> </NumberedList> </LineItem> <LineItem>Adult...
1
3464
by: CAM123 | last post by:
I have added: <br><xsl:value-of select="Line" /></br> to my XSLT stylesheet to get a line per repeating block. When I view the output as XML it looks perfect - one line per block. However when I output the file to a text file, all the data is wrapping and at the end of each block I am getting the text part of the header included but not all of it. The text that appears is: <br xmlns:msxsl="urn:schemas-microsoft-com:xslt"...
1
1430
by: Jeff.Thorn | last post by:
Hello All, I have a collection of data objects that are based on my application's data model. I want to be able to serialize this data to different XML formats (schemas) for use by different consuming applications. For example, I want to generate XML from the data one way for Application1, and generate XML in a different format for use by Application2. I don't think I can just serialize my objects as XML because I would
0
1745
by: mannem | last post by:
I have a problem in accessing the values while transforming an XML using XSLT BODY { FONT: x-small 'Verdana'; MARGIN-RIGHT: 1.5em } .c { CURSOR: hand } .b { FONT-WEIGHT: bold; COLOR: red; FONT-FAMILY: 'Courier New'; TEXT-DECORATION: none } .e { MARGIN-LEFT: 1em; TEXT-INDENT: -1em; MARGIN-RIGHT: 1em } .k { MARGIN-LEFT: 1em; TEXT-INDENT: -1em; MARGIN-RIGHT: 1em } .t { COLOR: #990000 } .xt { COLOR: #990099 } .ns { COLOR: red } .dt {...
0
9688
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
10490
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10243
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
10030
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...
1
7570
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6809
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
5467
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5590
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3762
muto222
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.