Subject: Re: IE does not comprehend default namespace in XML
From: denit thomas <denit_thomas@xxxxxxxxxxx>
Date: Fri, 28 Aug 2009 12:48:42 +0530 (IST)
|
Sperberg,
I managed to fix this issue. It was a very basic fix. I added the
default namespace in the stylesheet as well and had a prefix for it defined
too in the stylesheet. I then used the prefix to access the elements (from the
xml).
As I said I am pretty new to this :-)
Anyways, thanks a lot for your
time.
Regards,
Denit
--- On Fri, 28/8/09, denit thomas
<denit_thomas@xxxxxxxxxxx> wrote:
> From: denit thomas
<denit_thomas@xxxxxxxxxxx>
> Subject: Re: IE does not comprehend default
namespace in XML
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Date: Friday, 28
August, 2009, 11:55 AM
> Hi Sperberg,
> Thanks for your response. I am pretty
new to the XSD, XML
> and XSLT world. This is my XSLT.
>
> <?xml
version="1.0" encoding="utf-8"?>
> <xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:output
method="html"/>
> <xsl:template match="/">
> <html>
> <body>
> <table
> width="100%" cellpadding="10">
> <tr
>
width="100%">
>
> <td align="center">
>
>
<h2><xsl:value-of select="model/@name"
> /></h2>
>
> </td>
>
> </tr>
> <tr
> widht="100%">
>
> <td
align="left">
>
> <table width="60%" border="1">
>
>
<tr>
>
> <td width="30%">
>
>
<b>Description : </b>
>
> </td>
>
>
<td width="70%">
>
> <xsl:value-of
>
select="model/@description"/>
>
> </td>
>
> </tr>
>
> <tr>
>
> <td width="30%">
>
> <b>Product Key : </b>
>
> </td>
>
> <td width="70%">
>
> <xsl:value-of
>
select="model/@productKey"/>
>
> </td>
>
>
</tr>
>
> <tr>
>
> <td width="30%">
>
> <b>Naming Convention : </b>
>
> </td>
>
> <td width="70%">
>
> <xsl:value-of
>
select="model/@namingConv"/>
>
> </td>
>
> </tr>
>
> <tr>
>
> <td width="30%">
>
>
<b>Template : </b>
>
> </td>
>
>
<td width="70%">
>
> <xsl:value-of
>
select="model/@template"/>
>
> </td>
>
> </tr>
>
> <tr>
>
> <td width="30%">
>
>
<b>Create Mode : </b>
>
> </td>
>
>
<td width="70%">
>
> <xsl:value-of
>
select="model/@createMode"/>
>
> </td>
>
> </tr>
>
> <tr>
>
> <td width="30%">
>
>
<b>Notes : </b>
>
> </td>
>
> <td
width="70%">
>
> <xsl:value-of
> select="model/@notes"/>
>
> </td>
>
> </tr>
>
> </table>
>
> </td>
>
> </tr>
>
> </table>
>
</body>
> </html>
> </xsl:template>
> </xsl:stylesheet>
>
> I
tried changing the default namespace name to 'http://www.ncr.com/ocz' but that
did not work.
>
> Thanks & Regards,
> Denit
>
> --- On Thu, 27/8/09, C. M.
Sperberg-McQueen <cmsmcq@xxxxxxxxxxxxxxxxx>
> wrote:
>
> > From: C. M.
Sperberg-McQueen <cmsmcq@xxxxxxxxxxxxxxxxx>
> > Subject: Re: IE does not
comprehend default
> namespace in XML
> > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> > Cc: "C. M. Sperberg-McQueen" <cmsmcq@xxxxxxxxxxxxxxxxx>
> > Date:
Thursday, 27 August, 2009, 8:46 PM
> >
> > On 26 Aug 2009, at 22:32 , denit
thomas wrote:
> >
> > > Hi All,
> > > I am using an XSLT to parse an XML to
produce a
> text
> > file. The issue is tha=
> > > t if I use the Internet
Explorer to open this
> xml, it
> > does not render anyth=
> > > ing except
the hardcoded text that I have in the
> XSLT,
> > when I have the xmln=
> > >
s=3D"www.ncr.com/ocz" attribute in the root node
> of
> > the xml. As soon as
I r=
> > > emove this attibute, it works fine and the xslt
> gets
> > applied.
I need to kee=
> > > p this attribute in the xml as I have an XSD for
> this
>
> xml and thus need thi=
> > > s default namespace in xml.
> >
> > If I have
read your example correctly (some email
> encoding
> > issues made that harder
than usual), you have an XML
> > element whose namespace is "www.ncr.com/ocz"
and
> whose
> > local name is "model".
> >
> > First, note that the namespace
name you give is a
> relative
> > URI. Strictly speaking the various
XML-related
> > specifications
> > do not define what happens when relative
URIs are used
> as
> > namespace names; in particular, they do not have a
>
defined
> > XML infoset.
> >
> > So the first thing I'd try is using
"http://www.ncr.com/ocz"
> > or some other absolute URI as the namespace name.
> >
> > Second, are you confident that your XSLT stylesheet
> has
> > a match
for an element named "model" in the namespace
> > "www.ncr.com/ocz"? If the
template match attributes
> > match
> > "model" and so on, they won't fire for
> > {www.ncr.com/ocz}model
> > and the other elements in your document.
> >
>
> In case of doubt, show us a little of your
> stylesheet.
> >
> > I hope
this helps.
> >
> >
> >
>
--****************************************************************
> > * C. M.
Sperberg-McQueen, Black Mesa Technologies LLC
> > *
http://www.blackmesatech.com
> > * http://cmsmcq.com/mib
> > *
http://balisage.net
> >
>
****************************************************************
> >
> >
> >
> >
> >
> >
>
--~------------------------------------------------------------------
> >
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
> > To
unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
> > or e-mail:
<mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx>
> > --~--
> >
> >
>
>
> Love Cricket? Check out live scores,
> photos, video highlights and
more. Click here http://cricket.yahoo.com
>
>
--~------------------------------------------------------------------
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
> To
unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
> or e-mail:
<mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx>
> --~--
>
>
See
the Web's breaking stories, chosen by people like you. Check out Yahoo!
Buzz. http://in.buzz.yahoo.com/
|