XSL Woes

XSL Woes

Post by Phil » Fri, 21 Mar 2003 20:35:05



Hi,

I am having a problem transforming the xml response of
my .net webservice to html using xsl - I get a blank
screen. The odd part is that when I remove the final
namespace of the 'StockTest' root element it works fine.
As far as I know, I cannot remove the namespace from the
xml response. Can anyone help?

Here is the xml response:

<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="response.xsl"?>
<StockResponse
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://phil/">
  <Supplier>
    <SupplierCode>JAYM</SupplierCode>
    <SupplierName>JAYAR Maidstone</SupplierName>
    <AccessLevel>Price only</AccessLevel>
    <Comment>OK</Comment>
    <Part>
      <PartId>xxxx</PartId>
      <Response>OK</Response>
      <Stock>951</Stock>
      <Price>0</Price>
    </Part>
  </Supplier>
  <Supplier>
    <SupplierCode>xxxx</SupplierCode>
    <SupplierName>xxxx</SupplierName>
    <AccessLevel>Price only</AccessLevel>
    <Comment>OK</Comment>
    <Part>
      <PartId>xxxx</PartId>
      <Response>OK</Response>
      <Stock>951</Stock>
      <Price>0</Price>
    </Part>
  </Supplier>
</StockResponse>

Here is the xsl:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/">
    <html>
    <body>
      <xsl:for-each select="StockResponse/Supplier">
                <table border="1" style="margin-
bottom:10px">
                  <tr>
                        <td>Supplier Code</td>
                    <td><xsl:value-of
select="SupplierCode"/></td>
                  </tr>
                  <tr>
                        <td>Supplier Name</td>
                        <td><xsl:value-of
select="SupplierName"/></td>
                  </tr>
                  <tr>
                        <td>Access Rights</td>
                        <td><xsl:value-of
select="AccessLevel"/></td>
                  </tr>
                  <tr>
                        <td>Comment</td>
                        <td><xsl:value-of
select="Comment"/></td>
                  </tr>
                </table>
      </xsl:for-each>
    </body>
    </html>
  </xsl:template>
</xsl:stylesheet>

Thanks in advance,
Phil

 
 
 

XSL Woes

Post by Oleg Tkachenk » Fri, 21 Mar 2003 21:00:50



> I am having a problem transforming the xml response of
> my .net webservice to html using xsl - I get a blank
> screen. The odd part is that when I remove the final
> namespace of the 'StockTest' root element it works fine.
> As far as I know, I cannot remove the namespace from the
> xml response. Can anyone help?

It's a faq. See today's "what is wrong with the namespace in transformation?"
thread.
--
Oleg Tkachenko
Multiconn Technologies, Israel

 
 
 

XSL Woes

Post by Phil » Fri, 21 Mar 2003 22:55:13


Thankyou, I took the time (1hr) to read all of that
microsoft faq. If anyone wants to know.. the way I have
managed to style a .net xml webservice response with xsl
is:

In my xsl document I prefixed the namespace that my xml
response uses..

xmlns:x="http://phil/"

then updated my xpath queries to use this prefix..

<xsl:template match="x:StockResponse/x:Supplier">

..and it works fine for me!

>-----Original Message-----

>> I am having a problem transforming the xml response of
>> my .net webservice to html using xsl - I get a blank
>> screen. The odd part is that when I remove the final
>> namespace of the 'StockTest' root element it works
fine.
>> As far as I know, I cannot remove the namespace from
the
>> xml response. Can anyone help?

>It's a faq. See today's "what is wrong with the namespace

in transformation?"
Quote:>thread.
>--
>Oleg Tkachenko
>Multiconn Technologies, Israel

>.

 
 
 

1. XSL woes

I'm getting rather frustrated whilst trying to use <xsl:choose>.
I have this situation..

..
<xsl:choose>

<input type="text">
<xsl:attribute name="name"><xsl:value-of

<xsl:attribute name="id"><xsl:value-of

<xsl:attribute name="size"><xsl:value-of

<xsl:attribute name="value"><xsl:value-of
select="." /></xsl:attribute>
</input>
</xsl:if>
</xsl:when>
</xsl:choose>
..

yet when I attempt to transform the XML using this I get an
error:

error '80004005'
Unspecified error

/loanapp/test.asp, line 29

The XML and XSL are both valid and what I have appears to be
correct. Can anyone point out what's going wrong?

TIA

* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!

2. .net registry stuff

3. xsl:if woes

4. Outlook 97 e-mail sync

5. MSXML4 xsl:sort with parameter woes

6. Is there a way to configure wirelles connection for WiN XP through GP?

7. XSL Formatting Woes

8. HELP!! KERNE1.exe has VIRUS!!!

9. XSL Formatting Woes (Really ..)

10. XSL variable woes!

11. XML Schema Woes

12. XML Woes - this should be easy.

13. Schema Processor woes....