RE: Transformation Problem

Larry Trammell <[email protected]>
Newsgroups gmane.text.xml.xalan.java.user
Message-ID <[email protected]>
I have taken this as a tutorial problem for my own personal benefit, as my
understanding of XPATH and namespaces is severely lacking. I see no evidence
of processing problems, but plenty of reason to suspect problems with
resolution of your "default namespaces." Your example works after making the
following repairs:

  -- supply the appropriate termination tags to the xml document
  -- supply the appropriate xml and stylesheet tag to the xsl
  -- in the stylesheet tag, supply all of the namespace declarations
necessary to evaluate the stylesheet
  -- supply an explicit 'def' namespace declarations for the namespace used
as the default in the xml document
  -- repair the XPATH to the 'languageCode' and 'responseStatus' nodes by
specifying the 'SOAP-ENV:Body' nodes, not the 'soapenv:Header' nodes
  -- specify the 'def' namespace for the 'response', 'companyResponse' and
'responseHeader' nodes.

 
 -----Original Message-----
From: NOEL ALEX MAKUMULI [mailto:[email protected]]
Sent: Tuesday, April 28, 2009 1:29 PM
To: [email protected]
Subject: Transformation Problem


Hello
I am kind of new on working with XML and XSL transformation..
however i have worked with XSL transformation for a short time only..

i have a small problem which i am facing and i do not really understand what
is causing although i think the problem has something to do with the
namespace..

i try to transform a SOAP_Message XML file to a normal XML file and i can
get the values below the Header..meaning inside the the body element...

my XSL transformation looks like below...
<xsl:template match="/">
<Root>
<xsl:value-of select="SOAP-ENV:Envelope/soapenv:Header/cmn:timeStamp"/>
<xsl:value-of
select="SOAP-ENV:Envelope/soapenv:Header/ns:getReportResponse/response/compa
nyResponse/responseHeader/cmn:languageCode" />
<xsl:value-of
select="SOAP-ENV:Envelope/soapenv:Header/ns:getReportResponse/response/compa
nyResponse/responseHeader/cmn:responseStatus" />
</Root>

the timeStamp can be retrieved easily but however the field responseStatus
can not be retrieved..i get an empty element..

can someone please tell me what i am doing wrong??

i have tried to search for a nice reason and people have just hinted the
namespace issue and i have not managed to clear reason like what is the
cause exactly...

my sample XML message is below::
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soapenv:Header xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<cmn:timeStamp
xmlns:cmn="http://www.companyName.com/XMLSchema/compMain.xsd">123445+0001</c
mn:timeStamp>
</soapenv:Header>
<SOAP-ENV:Body>
<ns:getReportResponse xmlns:ns="http://www.companyName.com/company/">
<response xmlns:fs="http://www.companyName.com/XMLSchema/Company_4.xsd"
xmlns:cmn="http://www.companyName.com/XMLSchema/compMain.xsd"
xmlns:pr="http://www.companyName.com/XMLSchema/details.xsd"
xmlns="http://www.companyName.com/XMLSchema/compMain3.xsd"
xsi:SchemaLocation="http://www.companyName.com/XMLSchema/compMain3.xsd">
<companyResponse>
<responseHeader>
<cmn:languageCode
xmlns:cmn="http://www.companyName.com/XMLSchema/compMain.xsd">com</cmn:langu
ageCode>
<cmn:state
xmlns:cmn="http://www.companyName.com/XMLSchema/compMain.xsd">1</cmn:state>
</responseHeader>
</companyResponse>
</response>

thanks for help in advance
proby



check out the rest of the Windows Live(tm). More than mail-Windows Live(tm)
goes way beyond your inbox. More than messages
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.