Re: [xsl] xsl

Subject: Re: [xsl] xsl
From: "Jon Gorman" <jonathan.gorman@xxxxxxxxx>
Date: Wed, 3 May 2006 10:16:23 -0500
On 5/3/06, Indira Hoti <IHoti@xxxxxxxxxxxxxxx> wrote:
Hi all,

I haven't got much experience with XML and I just came across a code,
like the one below, which uses 'soap: Envelope' to encapsulate data.

There's a couple of things going wrong here.

First, you need to read up on namespaces.

My problem is in getting the xsl file to display that info. At the
moment with the xsl code below I can extract some information, but its
dsisplayed in one string or line, rather than assigned to a html table
cell. Any suggestions would be appreciated. Thanks J

What's happening is that your template is never matched, hence it uses the default templates. The default templates merely wanders down through the tree, printing out the string values of elements.




^^^^ so IdResponse and it's children are in the namespace";




<?xml version='1.0'?>






   ^^^ why have some of these namespaces?  You don't use all of them.
And you're missing the one you do need to access,  Add that with an appropriate prefix

<xsl:template match="soap:Envelope/soap:Body/IdResponse/IdResult">
Ok, you start the XPath correctly, but then leave out namespace for
the elements in the

Where the heck is that path coming from?   It's not in your example
xml.  I'm assuming you meant to simplify this for an example but
didn't.  Otherwise this isn't going to match anything.  Something
would though.

ps: I'll do my usual rant.  Download a command-line processor like
xsltproc, Saxon or even Xalan.  Converting via the browser hides too
much for a beginning user and just adds more confusion.

Jon Gorman

Current Thread