472,353 Members | 1,705 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

XSLT Brain Death has occured

I've been battling with this stupid problem for hours now.

WebApp:

Trying to do a simple transformation using XSLT to a Web Page, but it just
failes without an error message ( In other words, it bums out with a general
exeption with no message ).

It creates the Ouput.html, but errors and does not fill it with HTML.

Where am I going wrong ?

Cheers - OHM

//**********************************
//CODE
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim xreader As New XmlTextReader(Server.MapPath("XDATA.XML"))
Dim xDoc As XPathDocument = New XPathDocument(xreader)
Dim oXSLT As XslTransform = New XslTransform
Dim xWriter As XmlTextWriter = New
XmlTextWriter(Server.MapPath("Output.html"), Nothing)

Try
oXSLT.Load(Server.MapPath("XDATA.XSLT"))
oXSLT.Transform(xDoc, Nothing, xWriter)

Catch ex As XsltException
Response.Write("<B>FAILED - XSLT Exception </B" & ex.Message)
Catch ex As XsltCompileException
Response.Write("<B>FAILED: XLST Compilation Exception</B" &
ex.Message)
Catch ex As Exception
Response.Write("<B>FAILED: Unkown Exception - </B" & ex.Message)

Finally

xreader.Close()
xWriter.Close()
End Try
End Sub
//**************************************
// XML
<?xml version="1.0" encoding="utf-8" ?>
<bookstore xmlns="x-schmema:XDATA.xsd">

<book title="Wind In the Willows" author="Author Winkle"/>
<book title="Wind In the Bows" author="Martha Winkle"/>
<book title="Gale In the Willows" author="Susan Winkle"/>

</bookstore>

//****************************************
// XSD
<?xml version="1.0"?>
<xs:schema id="bookstore" targetNamespace="x-schmema:XDATA.xsd"
xmlns:mstns="x-schmema:XDATA.xsd" xmlns="x-schmema:XDATA.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:element name="bookstore" msdata:IsDataSet="true" msdata:Locale="en-GB"
msdata:EnforceConstraints="False">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="book">
<xs:complexType>
<xs:attribute name="title" form="unqualified" type="xs:string"
/>
<xs:attribute name="author" form="unqualified" type="xs:string"
/>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>

//*********************************************
// TRANSFORM
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0"
xmlns=xsl:"http://www.w3.org/1999/XSL/Transform"
xmlns:op="x-schemas:XDATA.xsd">
<xsl:template match="op:bookstore">
<HTML><BODY>
<TABLE>
<TR>
<TD><B>Title</B></TD>
<TD><B>Author</B></TD>
</TR>
<xsl:apply-templates select="op:book"/>
</TABLE>
</BODY></HTML>
</xsl:template>
<xsl:template match="op:book">
<TR>
<TR>
<TD><xsl:value-of select="op:title"/></TD>
</TR>
</TR>
</xsl:template>
</xsl:stylesheet>

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing
Nov 20 '05 #1
7 1195
Dont worry guys, I'm making headway with this, not there yet but getting
close.
Cheers

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
news:ea**************@TK2MSFTNGP10.phx.gbl...
I've been battling with this stupid problem for hours now.

WebApp:

Trying to do a simple transformation using XSLT to a Web Page, but it just
failes without an error message ( In other words, it bums out with a general exeption with no message ).

It creates the Ouput.html, but errors and does not fill it with HTML.

Where am I going wrong ?

Cheers - OHM

//**********************************
//CODE
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim xreader As New XmlTextReader(Server.MapPath("XDATA.XML"))
Dim xDoc As XPathDocument = New XPathDocument(xreader)
Dim oXSLT As XslTransform = New XslTransform
Dim xWriter As XmlTextWriter = New
XmlTextWriter(Server.MapPath("Output.html"), Nothing)

Try
oXSLT.Load(Server.MapPath("XDATA.XSLT"))
oXSLT.Transform(xDoc, Nothing, xWriter)

Catch ex As XsltException
Response.Write("<B>FAILED - XSLT Exception </B" & ex.Message)
Catch ex As XsltCompileException
Response.Write("<B>FAILED: XLST Compilation Exception</B" &
ex.Message)
Catch ex As Exception
Response.Write("<B>FAILED: Unkown Exception - </B" & ex.Message)
Finally

xreader.Close()
xWriter.Close()
End Try
End Sub
//**************************************
// XML
<?xml version="1.0" encoding="utf-8" ?>
<bookstore xmlns="x-schmema:XDATA.xsd">

<book title="Wind In the Willows" author="Author Winkle"/>
<book title="Wind In the Bows" author="Martha Winkle"/>
<book title="Gale In the Willows" author="Susan Winkle"/>

</bookstore>

//****************************************
// XSD
<?xml version="1.0"?>
<xs:schema id="bookstore" targetNamespace="x-schmema:XDATA.xsd"
xmlns:mstns="x-schmema:XDATA.xsd" xmlns="x-schmema:XDATA.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:element name="bookstore" msdata:IsDataSet="true" msdata:Locale="en-GB" msdata:EnforceConstraints="False">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="book">
<xs:complexType>
<xs:attribute name="title" form="unqualified" type="xs:string"
/>
<xs:attribute name="author" form="unqualified" type="xs:string" />
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>

//*********************************************
// TRANSFORM
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0"
xmlns=xsl:"http://www.w3.org/1999/XSL/Transform"
xmlns:op="x-schemas:XDATA.xsd">
<xsl:template match="op:bookstore">
<HTML><BODY>
<TABLE>
<TR>
<TD><B>Title</B></TD>
<TD><B>Author</B></TD>
</TR>
<xsl:apply-templates select="op:book"/>
</TABLE>
</BODY></HTML>
</xsl:template>
<xsl:template match="op:book">
<TR>
<TR>
<TD><xsl:value-of select="op:title"/></TD>
</TR>
</TR>
</xsl:template>
</xsl:stylesheet>

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

Nov 20 '05 #2
If anyone is interested, normal brain functions resumed this AM and problems
were fixed.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
news:uk**************@TK2MSFTNGP10.phx.gbl...
Dont worry guys, I'm making headway with this, not there yet but getting
close.
Cheers

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message news:ea**************@TK2MSFTNGP10.phx.gbl...
I've been battling with this stupid problem for hours now.

WebApp:

Trying to do a simple transformation using XSLT to a Web Page, but it just failes without an error message ( In other words, it bums out with a

general
exeption with no message ).

It creates the Ouput.html, but errors and does not fill it with HTML.

Where am I going wrong ?

Cheers - OHM

//**********************************
//CODE
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim xreader As New XmlTextReader(Server.MapPath("XDATA.XML"))
Dim xDoc As XPathDocument = New XPathDocument(xreader)
Dim oXSLT As XslTransform = New XslTransform
Dim xWriter As XmlTextWriter = New
XmlTextWriter(Server.MapPath("Output.html"), Nothing)

Try
oXSLT.Load(Server.MapPath("XDATA.XSLT"))
oXSLT.Transform(xDoc, Nothing, xWriter)

Catch ex As XsltException
Response.Write("<B>FAILED - XSLT Exception </B" & ex.Message) Catch ex As XsltCompileException
Response.Write("<B>FAILED: XLST Compilation Exception</B" &
ex.Message)
Catch ex As Exception
Response.Write("<B>FAILED: Unkown Exception - </B" &

ex.Message)

Finally

xreader.Close()
xWriter.Close()
End Try
End Sub
//**************************************
// XML
<?xml version="1.0" encoding="utf-8" ?>
<bookstore xmlns="x-schmema:XDATA.xsd">

<book title="Wind In the Willows" author="Author Winkle"/>
<book title="Wind In the Bows" author="Martha Winkle"/>
<book title="Gale In the Willows" author="Susan Winkle"/>

</bookstore>

//****************************************
// XSD
<?xml version="1.0"?>
<xs:schema id="bookstore" targetNamespace="x-schmema:XDATA.xsd"
xmlns:mstns="x-schmema:XDATA.xsd" xmlns="x-schmema:XDATA.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:element name="bookstore" msdata:IsDataSet="true"

msdata:Locale="en-GB"
msdata:EnforceConstraints="False">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="book">
<xs:complexType>
<xs:attribute name="title" form="unqualified" type="xs:string" />
<xs:attribute name="author" form="unqualified"

type="xs:string"
/>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>

//*********************************************
// TRANSFORM
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0"
xmlns=xsl:"http://www.w3.org/1999/XSL/Transform"
xmlns:op="x-schemas:XDATA.xsd">
<xsl:template match="op:bookstore">
<HTML><BODY>
<TABLE>
<TR>
<TD><B>Title</B></TD>
<TD><B>Author</B></TD>
</TR>
<xsl:apply-templates select="op:book"/>
</TABLE>
</BODY></HTML>
</xsl:template>
<xsl:template match="op:book">
<TR>
<TR>
<TD><xsl:value-of select="op:title"/></TD>
</TR>
</TR>
</xsl:template>
</xsl:stylesheet>

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing


Nov 20 '05 #3
That was quick. One mention of XML or XSLT and my brain stays dead for a
week :P
____________________
Grim

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
If anyone is interested, normal brain functions resumed this AM and problems were fixed.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message news:uk**************@TK2MSFTNGP10.phx.gbl...
Dont worry guys, I'm making headway with this, not there yet but getting
close.
Cheers

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in

message
news:ea**************@TK2MSFTNGP10.phx.gbl...
I've been battling with this stupid problem for hours now.

WebApp:

Trying to do a simple transformation using XSLT to a Web Page, but it just failes without an error message ( In other words, it bums out with a

general
exeption with no message ).

It creates the Ouput.html, but errors and does not fill it with HTML.

Where am I going wrong ?

Cheers - OHM

//**********************************
//CODE
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim xreader As New XmlTextReader(Server.MapPath("XDATA.XML"))
Dim xDoc As XPathDocument = New XPathDocument(xreader)
Dim oXSLT As XslTransform = New XslTransform
Dim xWriter As XmlTextWriter = New
XmlTextWriter(Server.MapPath("Output.html"), Nothing)

Try
oXSLT.Load(Server.MapPath("XDATA.XSLT"))
oXSLT.Transform(xDoc, Nothing, xWriter)

Catch ex As XsltException
Response.Write("<B>FAILED - XSLT Exception </B" & ex.Message) Catch ex As XsltCompileException
Response.Write("<B>FAILED: XLST Compilation Exception</B" & ex.Message)
Catch ex As Exception
Response.Write("<B>FAILED: Unkown Exception - </B" &

ex.Message)

Finally

xreader.Close()
xWriter.Close()
End Try
End Sub
//**************************************
// XML
<?xml version="1.0" encoding="utf-8" ?>
<bookstore xmlns="x-schmema:XDATA.xsd">

<book title="Wind In the Willows" author="Author Winkle"/>
<book title="Wind In the Bows" author="Martha Winkle"/>
<book title="Gale In the Willows" author="Susan Winkle"/>

</bookstore>

//****************************************
// XSD
<?xml version="1.0"?>
<xs:schema id="bookstore" targetNamespace="x-schmema:XDATA.xsd"
xmlns:mstns="x-schmema:XDATA.xsd" xmlns="x-schmema:XDATA.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:element name="bookstore" msdata:IsDataSet="true"

msdata:Locale="en-GB"
msdata:EnforceConstraints="False">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="book">
<xs:complexType>
<xs:attribute name="title" form="unqualified" type="xs:string" />
<xs:attribute name="author" form="unqualified"

type="xs:string"
/>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>

//*********************************************
// TRANSFORM
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0"
xmlns=xsl:"http://www.w3.org/1999/XSL/Transform"
xmlns:op="x-schemas:XDATA.xsd">
<xsl:template match="op:bookstore">
<HTML><BODY>
<TABLE>
<TR>
<TD><B>Title</B></TD>
<TD><B>Author</B></TD>
</TR>
<xsl:apply-templates select="op:book"/>
</TABLE>
</BODY></HTML>
</xsl:template>
<xsl:template match="op:book">
<TR>
<TR>
<TD><xsl:value-of select="op:title"/></TD>
</TR>
</TR>
</xsl:template>
</xsl:stylesheet>

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing



Nov 20 '05 #4
I must admit, I have found transformations a bit of a challenge

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"The Grim Reaper" <gr*********@btopenworld.com> wrote in message
news:cc**********@titan.btinternet.com...
That was quick. One mention of XML or XSLT and my brain stays dead for a
week :P
____________________
Grim

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message news:%2****************@tk2msftngp13.phx.gbl...
If anyone is interested, normal brain functions resumed this AM and problems
were fixed.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in

message
news:uk**************@TK2MSFTNGP10.phx.gbl...
Dont worry guys, I'm making headway with this, not there yet but getting close.
Cheers

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in

message
news:ea**************@TK2MSFTNGP10.phx.gbl...
> I've been battling with this stupid problem for hours now.
>
> WebApp:
>
> Trying to do a simple transformation using XSLT to a Web Page, but it
just
> failes without an error message ( In other words, it bums out with a
general
> exeption with no message ).
>
> It creates the Ouput.html, but errors and does not fill it with
HTML. >
> Where am I going wrong ?
>
> Cheers - OHM
>
> //**********************************
> //CODE
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> 'Put user code to initialize the page here
> Dim xreader As New XmlTextReader(Server.MapPath("XDATA.XML")) > Dim xDoc As XPathDocument = New XPathDocument(xreader)
> Dim oXSLT As XslTransform = New XslTransform
> Dim xWriter As XmlTextWriter = New
> XmlTextWriter(Server.MapPath("Output.html"), Nothing)
>
> Try
> oXSLT.Load(Server.MapPath("XDATA.XSLT"))
> oXSLT.Transform(xDoc, Nothing, xWriter)
>
> Catch ex As XsltException
> Response.Write("<B>FAILED - XSLT Exception </B" &

ex.Message)
> Catch ex As XsltCompileException
> Response.Write("<B>FAILED: XLST Compilation

Exception</B" & > ex.Message)
> Catch ex As Exception
> Response.Write("<B>FAILED: Unkown Exception - </B" &
ex.Message)
>
> Finally
>
> xreader.Close()
> xWriter.Close()
> End Try
> End Sub
>
>
> //**************************************
> // XML
> <?xml version="1.0" encoding="utf-8" ?>
> <bookstore xmlns="x-schmema:XDATA.xsd">
>
> <book title="Wind In the Willows" author="Author Winkle"/>
> <book title="Wind In the Bows" author="Martha Winkle"/>
> <book title="Gale In the Willows" author="Susan Winkle"/>
>
> </bookstore>
>
> //****************************************
> // XSD
> <?xml version="1.0"?>
> <xs:schema id="bookstore" targetNamespace="x-schmema:XDATA.xsd"
> xmlns:mstns="x-schmema:XDATA.xsd" xmlns="x-schmema:XDATA.xsd"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
> attributeFormDefault="qualified" elementFormDefault="qualified">
> <xs:element name="bookstore" msdata:IsDataSet="true"
msdata:Locale="en-GB"
> msdata:EnforceConstraints="False">
> <xs:complexType>
> <xs:choice maxOccurs="unbounded">
> <xs:element name="book">
> <xs:complexType>
> <xs:attribute name="title" form="unqualified"

type="xs:string"
> />
> <xs:attribute name="author" form="unqualified"
type="xs:string"
> />
> </xs:complexType>
> </xs:element>
> </xs:choice>
> </xs:complexType>
> </xs:element>
> </xs:schema>
>
> //*********************************************
> // TRANSFORM
> <?xml version="1.0" encoding="UTF-8" ?>
> <xsl:stylesheet version="1.0"
> xmlns=xsl:"http://www.w3.org/1999/XSL/Transform"
> xmlns:op="x-schemas:XDATA.xsd">
> <xsl:template match="op:bookstore">
> <HTML><BODY>
> <TABLE>
> <TR>
> <TD><B>Title</B></TD>
> <TD><B>Author</B></TD>
> </TR>
> <xsl:apply-templates select="op:book"/>
> </TABLE>
> </BODY></HTML>
> </xsl:template>
> <xsl:template match="op:book">
> <TR>
> <TR>
> <TD><xsl:value-of select="op:title"/></TD>
> </TR>
> </TR>
> </xsl:template>
> </xsl:stylesheet>
>
> --
>
> OHM ( Terry Burns )
> . . . One-Handed-Man . . .
>
> Time flies when you don't know what you're doing
>
>



Nov 20 '05 #5
I will reply to that statement in approximately 7 days :S
___________
Grim
"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
news:uu**************@TK2MSFTNGP09.phx.gbl...
I must admit, I have found transformations a bit of a challenge

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"The Grim Reaper" <gr*********@btopenworld.com> wrote in message
news:cc**********@titan.btinternet.com...
That was quick. One mention of XML or XSLT and my brain stays dead for a
week :P
____________________
Grim

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in

message
news:%2****************@tk2msftngp13.phx.gbl...
If anyone is interested, normal brain functions resumed this AM and

problems
were fixed.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in

message
news:uk**************@TK2MSFTNGP10.phx.gbl...
> Dont worry guys, I'm making headway with this, not there yet but

getting > close.
>
>
> Cheers
>
> --
>
> OHM ( Terry Burns )
> . . . One-Handed-Man . . .
>
> Time flies when you don't know what you're doing
>
> "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in
message
> news:ea**************@TK2MSFTNGP10.phx.gbl...
> > I've been battling with this stupid problem for hours now.
> >
> > WebApp:
> >
> > Trying to do a simple transformation using XSLT to a Web Page, but it just
> > failes without an error message ( In other words, it bums out with a > general
> > exeption with no message ).
> >
> > It creates the Ouput.html, but errors and does not fill it with HTML. > >
> > Where am I going wrong ?
> >
> > Cheers - OHM
> >
> > //**********************************
> > //CODE
> > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As > > System.EventArgs) Handles MyBase.Load
> > 'Put user code to initialize the page here
> > Dim xreader As New XmlTextReader(Server.MapPath("XDATA.XML")) > > Dim xDoc As XPathDocument = New XPathDocument(xreader)
> > Dim oXSLT As XslTransform = New XslTransform
> > Dim xWriter As XmlTextWriter = New
> > XmlTextWriter(Server.MapPath("Output.html"), Nothing)
> >
> > Try
> > oXSLT.Load(Server.MapPath("XDATA.XSLT"))
> > oXSLT.Transform(xDoc, Nothing, xWriter)
> >
> > Catch ex As XsltException
> > Response.Write("<B>FAILED - XSLT Exception </B" &
ex.Message)
> > Catch ex As XsltCompileException
> > Response.Write("<B>FAILED: XLST Compilation

Exception</B"
&
> > ex.Message)
> > Catch ex As Exception
> > Response.Write("<B>FAILED: Unkown Exception - </B" &
> ex.Message)
> >
> > Finally
> >
> > xreader.Close()
> > xWriter.Close()
> > End Try
> > End Sub
> >
> >
> > //**************************************
> > // XML
> > <?xml version="1.0" encoding="utf-8" ?>
> > <bookstore xmlns="x-schmema:XDATA.xsd">
> >
> > <book title="Wind In the Willows" author="Author Winkle"/>
> > <book title="Wind In the Bows" author="Martha Winkle"/>
> > <book title="Gale In the Willows" author="Susan Winkle"/>
> >
> > </bookstore>
> >
> > //****************************************
> > // XSD
> > <?xml version="1.0"?>
> > <xs:schema id="bookstore" targetNamespace="x-schmema:XDATA.xsd"
> > xmlns:mstns="x-schmema:XDATA.xsd" xmlns="x-schmema:XDATA.xsd"
> > xmlns:xs="http://www.w3.org/2001/XMLSchema"
> > xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
> > attributeFormDefault="qualified" elementFormDefault="qualified">
> > <xs:element name="bookstore" msdata:IsDataSet="true"
> msdata:Locale="en-GB"
> > msdata:EnforceConstraints="False">
> > <xs:complexType>
> > <xs:choice maxOccurs="unbounded">
> > <xs:element name="book">
> > <xs:complexType>
> > <xs:attribute name="title" form="unqualified"
type="xs:string"
> > />
> > <xs:attribute name="author" form="unqualified"
> type="xs:string"
> > />
> > </xs:complexType>
> > </xs:element>
> > </xs:choice>
> > </xs:complexType>
> > </xs:element>
> > </xs:schema>
> >
> > //*********************************************
> > // TRANSFORM
> > <?xml version="1.0" encoding="UTF-8" ?>
> > <xsl:stylesheet version="1.0"
> > xmlns=xsl:"http://www.w3.org/1999/XSL/Transform"
> > xmlns:op="x-schemas:XDATA.xsd">
> > <xsl:template match="op:bookstore">
> > <HTML><BODY>
> > <TABLE>
> > <TR>
> > <TD><B>Title</B></TD>
> > <TD><B>Author</B></TD>
> > </TR>
> > <xsl:apply-templates select="op:book"/>
> > </TABLE>
> > </BODY></HTML>
> > </xsl:template>
> > <xsl:template match="op:book">
> > <TR>
> > <TR>
> > <TD><xsl:value-of select="op:title"/></TD>
> > </TR>
> > </TR>
> > </xsl:template>
> > </xsl:stylesheet>
> >
> > --
> >
> > OHM ( Terry Burns )
> > . . . One-Handed-Man . . .
> >
> > Time flies when you don't know what you're doing
> >
> >
>
>



Nov 20 '05 #6
Does that mean you are looking at them as well ?

BTW, what does :S mean ?

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"The Grim Reaper" <gr*********@btopenworld.com> wrote in message
news:cc**********@sparta.btinternet.com...
I will reply to that statement in approximately 7 days :S
___________
Grim
"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message news:uu**************@TK2MSFTNGP09.phx.gbl...
I must admit, I have found transformations a bit of a challenge

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"The Grim Reaper" <gr*********@btopenworld.com> wrote in message
news:cc**********@titan.btinternet.com...
That was quick. One mention of XML or XSLT and my brain stays dead for
a
week :P
____________________
Grim

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
> If anyone is interested, normal brain functions resumed this AM and
problems
> were fixed.
>
> --
>
> OHM ( Terry Burns )
> . . . One-Handed-Man . . .
>
> Time flies when you don't know what you're doing
>
> "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in
message
> news:uk**************@TK2MSFTNGP10.phx.gbl...
> > Dont worry guys, I'm making headway with this, not there yet but

getting
> > close.
> >
> >
> > Cheers
> >
> > --
> >
> > OHM ( Terry Burns )
> > . . . One-Handed-Man . . .
> >
> > Time flies when you don't know what you're doing
> >
> > "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote
in > message
> > news:ea**************@TK2MSFTNGP10.phx.gbl...
> > > I've been battling with this stupid problem for hours now.
> > >
> > > WebApp:
> > >
> > > Trying to do a simple transformation using XSLT to a Web Page,
but it
> just
> > > failes without an error message ( In other words, it bums out

with a > > general
> > > exeption with no message ).
> > >
> > > It creates the Ouput.html, but errors and does not fill it with

HTML.
> > >
> > > Where am I going wrong ?
> > >
> > > Cheers - OHM
> > >
> > > //**********************************
> > > //CODE
> > > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As > > > System.EventArgs) Handles MyBase.Load
> > > 'Put user code to initialize the page here
> > > Dim xreader As New

XmlTextReader(Server.MapPath("XDATA.XML"))
> > > Dim xDoc As XPathDocument = New XPathDocument(xreader)
> > > Dim oXSLT As XslTransform = New XslTransform
> > > Dim xWriter As XmlTextWriter = New
> > > XmlTextWriter(Server.MapPath("Output.html"), Nothing)
> > >
> > > Try
> > > oXSLT.Load(Server.MapPath("XDATA.XSLT"))
> > > oXSLT.Transform(xDoc, Nothing, xWriter)
> > >
> > > Catch ex As XsltException
> > > Response.Write("<B>FAILED - XSLT Exception </B" &
> ex.Message)
> > > Catch ex As XsltCompileException
> > > Response.Write("<B>FAILED: XLST Compilation

Exception</B"
&
> > > ex.Message)
> > > Catch ex As Exception
> > > Response.Write("<B>FAILED: Unkown Exception - </B" &
> > ex.Message)
> > >
> > > Finally
> > >
> > > xreader.Close()
> > > xWriter.Close()
> > > End Try
> > > End Sub
> > >
> > >
> > > //**************************************
> > > // XML
> > > <?xml version="1.0" encoding="utf-8" ?>
> > > <bookstore xmlns="x-schmema:XDATA.xsd">
> > >
> > > <book title="Wind In the Willows" author="Author Winkle"/>
> > > <book title="Wind In the Bows" author="Martha Winkle"/>
> > > <book title="Gale In the Willows" author="Susan Winkle"/>
> > >
> > > </bookstore>
> > >
> > > //****************************************
> > > // XSD
> > > <?xml version="1.0"?>
> > > <xs:schema id="bookstore" targetNamespace="x-schmema:XDATA.xsd"
> > > xmlns:mstns="x-schmema:XDATA.xsd" xmlns="x-schmema:XDATA.xsd"
> > > xmlns:xs="http://www.w3.org/2001/XMLSchema"
> > > xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
> > > attributeFormDefault="qualified" elementFormDefault="qualified">
> > > <xs:element name="bookstore" msdata:IsDataSet="true"
> > msdata:Locale="en-GB"
> > > msdata:EnforceConstraints="False">
> > > <xs:complexType>
> > > <xs:choice maxOccurs="unbounded">
> > > <xs:element name="book">
> > > <xs:complexType>
> > > <xs:attribute name="title" form="unqualified"
> type="xs:string"
> > > />
> > > <xs:attribute name="author" form="unqualified"
> > type="xs:string"
> > > />
> > > </xs:complexType>
> > > </xs:element>
> > > </xs:choice>
> > > </xs:complexType>
> > > </xs:element>
> > > </xs:schema>
> > >
> > > //*********************************************
> > > // TRANSFORM
> > > <?xml version="1.0" encoding="UTF-8" ?>
> > > <xsl:stylesheet version="1.0"
> > > xmlns=xsl:"http://www.w3.org/1999/XSL/Transform"
> > > xmlns:op="x-schemas:XDATA.xsd">
> > > <xsl:template match="op:bookstore">
> > > <HTML><BODY>
> > > <TABLE>
> > > <TR>
> > > <TD><B>Title</B></TD>
> > > <TD><B>Author</B></TD>
> > > </TR>
> > > <xsl:apply-templates select="op:book"/>
> > > </TABLE>
> > > </BODY></HTML>
> > > </xsl:template>
> > > <xsl:template match="op:book">
> > > <TR>
> > > <TR>
> > > <TD><xsl:value-of select="op:title"/></TD>
> > > </TR>
> > > </TR>
> > > </xsl:template>
> > > </xsl:stylesheet>
> > >
> > > --
> > >
> > > OHM ( Terry Burns )
> > > . . . One-Handed-Man . . .
> > >
> > > Time flies when you don't know what you're doing
> > >
> > >
> >
> >
>
>



Nov 20 '05 #7
No, it doesn't - sorry!! I'm busy trying to get data from a 64 pin I/O card
and cross-linked PLC :)

:S is an MSN Messenger smiley - it's a confused look. Wiggly mouth sort of
thing.
_____________________________
Grim

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
news:ec**************@TK2MSFTNGP12.phx.gbl...
Does that mean you are looking at them as well ?

BTW, what does :S mean ?

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"The Grim Reaper" <gr*********@btopenworld.com> wrote in message
news:cc**********@sparta.btinternet.com...
I will reply to that statement in approximately 7 days :S
___________
Grim
"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
news:uu**************@TK2MSFTNGP09.phx.gbl...
I must admit, I have found transformations a bit of a challenge

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"The Grim Reaper" <gr*********@btopenworld.com> wrote in message
news:cc**********@titan.btinternet.com...
> That was quick. One mention of XML or XSLT and my brain stays dead for
a
> week :P
> ____________________
> Grim
>
> "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in
message
> news:%2****************@tk2msftngp13.phx.gbl...
> > If anyone is interested, normal brain functions resumed this AM and > problems
> > were fixed.
> >
> > --
> >
> > OHM ( Terry Burns )
> > . . . One-Handed-Man . . .
> >
> > Time flies when you don't know what you're doing
> >
> > "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in > message
> > news:uk**************@TK2MSFTNGP10.phx.gbl...
> > > Dont worry guys, I'm making headway with this, not there yet but
getting
> > > close.
> > >
> > >
> > > Cheers
> > >
> > > --
> > >
> > > OHM ( Terry Burns )
> > > . . . One-Handed-Man . . .
> > >
> > > Time flies when you don't know what you're doing
> > >
> > > "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in > > message
> > > news:ea**************@TK2MSFTNGP10.phx.gbl...
> > > > I've been battling with this stupid problem for hours now.
> > > >
> > > > WebApp:
> > > >
> > > > Trying to do a simple transformation using XSLT to a Web Page, but it
> > just
> > > > failes without an error message ( In other words, it bums out with
a
> > > general
> > > > exeption with no message ).
> > > >
> > > > It creates the Ouput.html, but errors and does not fill it

with HTML.
> > > >
> > > > Where am I going wrong ?
> > > >
> > > > Cheers - OHM
> > > >
> > > > //**********************************
> > > > //CODE
> > > > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> > > > System.EventArgs) Handles MyBase.Load
> > > > 'Put user code to initialize the page here
> > > > Dim xreader As New
XmlTextReader(Server.MapPath("XDATA.XML"))
> > > > Dim xDoc As XPathDocument = New XPathDocument(xreader)
> > > > Dim oXSLT As XslTransform = New XslTransform
> > > > Dim xWriter As XmlTextWriter = New
> > > > XmlTextWriter(Server.MapPath("Output.html"), Nothing)
> > > >
> > > > Try
> > > > oXSLT.Load(Server.MapPath("XDATA.XSLT"))
> > > > oXSLT.Transform(xDoc, Nothing, xWriter)
> > > >
> > > > Catch ex As XsltException
> > > > Response.Write("<B>FAILED - XSLT Exception </B" &
> > ex.Message)
> > > > Catch ex As XsltCompileException
> > > > Response.Write("<B>FAILED: XLST Compilation
Exception</B"
> &
> > > > ex.Message)
> > > > Catch ex As Exception
> > > > Response.Write("<B>FAILED: Unkown Exception - </B"

& > > > ex.Message)
> > > >
> > > > Finally
> > > >
> > > > xreader.Close()
> > > > xWriter.Close()
> > > > End Try
> > > > End Sub
> > > >
> > > >
> > > > //**************************************
> > > > // XML
> > > > <?xml version="1.0" encoding="utf-8" ?>
> > > > <bookstore xmlns="x-schmema:XDATA.xsd">
> > > >
> > > > <book title="Wind In the Willows" author="Author Winkle"/>
> > > > <book title="Wind In the Bows" author="Martha Winkle"/>
> > > > <book title="Gale In the Willows" author="Susan Winkle"/>
> > > >
> > > > </bookstore>
> > > >
> > > > //****************************************
> > > > // XSD
> > > > <?xml version="1.0"?>
> > > > <xs:schema id="bookstore" targetNamespace="x-schmema:XDATA.xsd" > > > > xmlns:mstns="x-schmema:XDATA.xsd" xmlns="x-schmema:XDATA.xsd"
> > > > xmlns:xs="http://www.w3.org/2001/XMLSchema"
> > > > xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
> > > > attributeFormDefault="qualified" elementFormDefault="qualified"> > > > > <xs:element name="bookstore" msdata:IsDataSet="true"
> > > msdata:Locale="en-GB"
> > > > msdata:EnforceConstraints="False">
> > > > <xs:complexType>
> > > > <xs:choice maxOccurs="unbounded">
> > > > <xs:element name="book">
> > > > <xs:complexType>
> > > > <xs:attribute name="title" form="unqualified"
> > type="xs:string"
> > > > />
> > > > <xs:attribute name="author" form="unqualified"
> > > type="xs:string"
> > > > />
> > > > </xs:complexType>
> > > > </xs:element>
> > > > </xs:choice>
> > > > </xs:complexType>
> > > > </xs:element>
> > > > </xs:schema>
> > > >
> > > > //*********************************************
> > > > // TRANSFORM
> > > > <?xml version="1.0" encoding="UTF-8" ?>
> > > > <xsl:stylesheet version="1.0"
> > > > xmlns=xsl:"http://www.w3.org/1999/XSL/Transform"
> > > > xmlns:op="x-schemas:XDATA.xsd">
> > > > <xsl:template match="op:bookstore">
> > > > <HTML><BODY>
> > > > <TABLE>
> > > > <TR>
> > > > <TD><B>Title</B></TD>
> > > > <TD><B>Author</B></TD>
> > > > </TR>
> > > > <xsl:apply-templates select="op:book"/>
> > > > </TABLE>
> > > > </BODY></HTML>
> > > > </xsl:template>
> > > > <xsl:template match="op:book">
> > > > <TR>
> > > > <TR>
> > > > <TD><xsl:value-of select="op:title"/></TD>
> > > > </TR>
> > > > </TR>
> > > > </xsl:template>
> > > > </xsl:stylesheet>
> > > >
> > > > --
> > > >
> > > > OHM ( Terry Burns )
> > > > . . . One-Handed-Man . . .
> > > >
> > > > Time flies when you don't know what you're doing
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 20 '05 #8

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

Similar topics

1
by: Thomas Miller | last post by:
Here is my code that works fine. I am wondering if there is a better way to do this. In my xslt transformation it seems I HAVE to reference an...
5
by: Brandolon Hill | last post by:
Hi, Is there a way to check and see if a parameter is defined in XSLT? I have many stylesheets that all have an <xsl:include> of the same...
3
by: Darren Davison | last post by:
Hi, I have a documentation tool based on Java and XSLT that I want to add i18n capability to. There are around 8 stylesheets that process a Source...
1
by: Ric Castagna | last post by:
Greetings from Snowy Charlotte... I am trying to create a dynamic web site that will be "skinned" based upon an authenticated user's information....
3
by: One Handed Man \( OHM - Terry Burns \) | last post by:
Yes, my brain is once again dead ( this is my mind writing using a supernatural force ). I'm trying to validate an xml file against its schema, I...
3
by: Carles Company Soler | last post by:
Hello, I want to calculate the value of an attribute. For example <rect x="2+3" y="12"and be <rect x="5" y="12">. Is it possible using XSLT? ...
10
by: olivier.scalbert | last post by:
Hello, the following constraints: source: <Source> <Item>AAA</Item> <Item>BBBBBBBBBBB</Item> <Item>CCCCCCCCC</Item>...
1
by: killy971 | last post by:
I am using the following syntax, with Xalan, to process xml transformations in java: StreamSource xml = new StreamSource(xmlFile); StreamSource...
2
by: saritha2008 | last post by:
Hi, As part of transforming one form of xml to another form, i need to do the below mentioned transformation: My Input XML: <rss> <channel>...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...

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.