.NETGURU
Please help me!
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngwebcontrols' list.


Dominic Grandmont

Please help me!!!

I'm just trying to learn XSLT. I want to use XSLT to transform my XML data
to be able to use the IE Treeview webcontrol. What I've done is that:

1- Transformed my dataset into XML with the command WriteXML ("filename",
XmlWriteMode.IgnoreSchema)
2- the result was that:
<?xml version="1.0" standalone="yes" ?>
<DSAdress xmlns="http://www.tempuri.org/DSAdress.xsd";>
    <TableAdress>
        <id>1</id>
        <adress>http://www.here.com</adress>
    </TableAdress>
    <TableAdress>
        <id>2</id>
        <adress>http://www.there.com</adress>
    </TableAdress>
</DSAdress>

But my problem is when I want to walk through my xml file. I'm unable to
reach any child nodes. There's only the slash "/" that worked. Everything
else gave me error like: "There is invalid data at the root level 1". I
tried with an XML file that didn't contained an inline schema and it worked.
But when you use the WriteXML method, VS put a namespace in my xml file. Is
it the reason why it doesn't work? This is my XSLT. Please help me.

Domgrant
---------

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version='1.0' >
    <xsl:template match="/">
        <TREENODES>
            <!--<treenode Text="TableAdress" >-->
                <xsl:for-each select="DSAdress/TableAdress">
                    <xsl:element name="treenode">
                        <xsl:attribute name="DefaultStyle">background:#CCFF66;border:solid
1px;color:blue;font-size:9pt</xsl:attribute>
                        <xsl:attribute
name="HoverStyle">background:#FF66CC;color:brown;font-name;Arial</xsl:attribute>
                        <xsl:attribute
name="SelectedStyle">color:red;font-name=Tahoma;font-weight:bold-italic</xsl:attribute>
                        <xsl:attribute name="Text" >Will It work <xsl:value-of
select="DSAdress/TableAdress/id"/></xsl:attribute>
                        <xsl:attribute name="Target" >_blank</xsl:attribute>
                    </xsl:element>
                </xsl:for-each>
            <!--</treenode>-->
        </TREENODES>
    </xsl:template>
</xsl:stylesheet>

---------

_________________________________________________________________
Affichez, modifiez et partagez gratuitement vos photos en ligne:
http://photos.msn.com/support/worldwide.aspx

Reply to this message...
 
    
Brian Estep
Dominic,

Try reading this code sample from the asp.net forums
http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&;PostID=7034
I think it dose a very good job of explaining what your trying
to do. Hope it helps.

Brian S. Estep
bsapd

--- Dominic Grandmont <Click here to reveal e-mail address> wrote:
>
>
> Please help me!!!
>
> I'm just trying to learn XSLT. I want to use XSLT to transform my XML data
> to be able to use the IE Treeview webcontrol. What I've done is that:
>
> 1- Transformed my dataset into XML with the command WriteXML ("filename",
> XmlWriteMode.IgnoreSchema)
> 2- the result was that:
> <?xml version="1.0" standalone="yes" ?>
> <DSAdress xmlns="http://www.tempuri.org/DSAdress.xsd&#34;>
>     <TableAdress>
>         <id>1</id>
>         <adress>http://www.here.com<;/adress>
>     </TableAdress>
>     <TableAdress>
>         <id>2</id>
>         <adress>http://www.there.com<;/adress>
>     </TableAdress>
> </DSAdress>
>
> But my problem is when I want to walk through my xml file. I'm unable to
> reach any child nodes. There's only the slash "/" that worked. Everything
> else gave me error like: "There is invalid data at the root level 1". I
> tried with an XML file that didn't contained an inline schema and it worked.
> But when you use the WriteXML method, VS put a namespace in my xml file. Is
> it the reason why it doesn't work? This is my XSLT. Please help me.
>
> Domgrant
> ---------
>
>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform&#34;
> version='1.0' >
>     <xsl:template match="/">
>         <TREENODES>
>             <!--<treenode Text="TableAdress" >-->
>                 <xsl:for-each select="DSAdress/TableAdress">
>                     <xsl:element name="treenode">
>                         <xsl:attribute name="DefaultStyle">background:#CCFF66;border:solid
> 1px;color:blue;font-size:9pt</xsl:attribute>
>                         <xsl:attribute
>
name="HoverStyle">background:#FF66CC;color:brown;font-name;Arial</xsl:attribute>
>                         <xsl:attribute
>
name="SelectedStyle">color:red;font-name=Tahoma;font-weight:bold-italic</xsl:attribute>
>                         <xsl:attribute name="Text" >Will It work <xsl:value-of
> select="DSAdress/TableAdress/id"/></xsl:attribute>
>                         <xsl:attribute name="Target" >_blank</xsl:attribute>
>                     </xsl:element>
>                 </xsl:for-each>
>             <!--</treenode>-->
>         </TREENODES>
>     </xsl:template>
> </xsl:stylesheet>
>
>
> ---------
>
> _________________________________________________________________
> Affichez, modifiez et partagez gratuitement vos photos en ligne:
> http://photos.msn.com/support/worldwide.aspx
>
>
> | [aspngwebcontrols] member Click here to reveal e-mail address = YOUR ID
> | http://www.asplists.com/asplists/aspngwebcontrols.asp = JOIN/QUIT

__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

Reply to this message...
 
    
Chesnut, Casey
yes, you need to add the doc namespace on your XSLT
xmlns:src=3D"http://www.tempuri.org/DSAdress.xsd";

and then the namespace prefix will need to be on the xpaths
<xsl:for-each select=3D"//src:DSAdress/src:TableAdress">

-----Original Message-----
From: Dominic Grandmont [mailto:Click here to reveal e-mail address]
Sent: Tuesday, July 23, 2002 3:18 PM
To: aspngwebcontrols
Subject: [aspngwebcontrols] Please help me!!!

Please help me!!!

I'm just trying to learn XSLT. I want to use XSLT to transform my XML =
data=20
to be able to use the IE Treeview webcontrol. What I've done is that:

1- Transformed my dataset into XML with the command WriteXML =
("filename",=20
XmlWriteMode.IgnoreSchema)
2- the result was that:
<?xml version=3D"1.0" standalone=3D"yes" ?>
<DSAdress xmlns=3D"http://www.tempuri.org/DSAdress.xsd";>
    <TableAdress>
        <id>1</id>
        <adress>http://www.here.com</adress>
    </TableAdress>
    <TableAdress>
        <id>2</id>
        <adress>http://www.there.com</adress>
    </TableAdress>
</DSAdress>

But my problem is when I want to walk through my xml file. I'm unable to =

reach any child nodes. There's only the slash "/" that worked. =
Everything=20
else gave me error like: "There is invalid data at the root level 1". I =

tried with an XML file that didn't contained an inline schema and it =
worked.=20
But when you use the WriteXML method, VS put a namespace in my xml file. =
Is=20
it the reason why it doesn't work? This is my XSLT. Please help me.

Domgrant
---------

<xsl:stylesheet xmlns:xsl=3D"http://www.w3.org/1999/XSL/Transform";=20
version=3D'1.0' >
    <xsl:template match=3D"/">
        <TREENODES>
            <!--<treenode Text=3D"TableAdress" >-->
                <xsl:for-each select=3D"DSAdress/TableAdress">
                    <xsl:element name=3D"treenode">
                        <xsl:attribute =
name=3D"DefaultStyle">background:#CCFF66;border:solid=20
1px;color:blue;font-size:9pt</xsl:attribute>
                        <xsl:attribute=20
name=3D"HoverStyle">background:#FF66CC;color:brown;font-name;Arial</xsl:a=
ttribute>
                        <xsl:attribute=20
name=3D"SelectedStyle">color:red;font-name=3DTahoma;font-weight:bold-ital=
ic</xsl:attribute>
                        <xsl:attribute name=3D"Text" >Will It work <xsl:value-of=20
select=3D"DSAdress/TableAdress/id"/></xsl:attribute>
                        <xsl:attribute name=3D"Target" >_blank</xsl:attribute>
                    </xsl:element>
                </xsl:for-each>
            <!--</treenode>-->
        </TREENODES>
    </xsl:template>
</xsl:stylesheet>

---------

_________________________________________________________________
Affichez, modifiez et partagez gratuitement vos photos en ligne:=20
http://photos.msn.com/support/worldwide.aspx

| [aspngwebcontrols] member Click here to reveal e-mail address =3D YOUR ID
| http://www.asplists.com/asplists/aspngwebcontrols.asp =3D JOIN/QUIT

Reply to this message...
 
    
Alex Lowe
Either Brian's email program or our moderation tool monkeyed with the =
URL in his post. The correct URL is =
(http://www.asp.net/Forums/ShowPost.aspx?tabindex=3D1&PostID=3D7034).

Regards,
Alex
AspFriends.com Moderation Team

----- Original Message -----
From: Brian Estep <Click here to reveal e-mail address>
To: Click here to reveal e-mail address
Sent: Wed, 24 Jul 2002 06:14:43 -0700 (PDT)
Subject: Re: [aspngwebcontrols] Please help me!!!
[Original message clipped]

Reply to this message...
 
    
Joan Cavanaugh

-----Original Message-----
From: Chesnut, Casey [mailto:Click here to reveal e-mail address]
Sent: Wednesday, July 24, 2002 9:50 AM
To: aspngwebcontrols
Subject: [aspngwebcontrols] RE: Please help me!!!

yes, you need to add the doc namespace on your XSLT
xmlns:src="http://www.tempuri.org/DSAdress.xsd";

and then the namespace prefix will need to be on the xpaths
<xsl:for-each select="//src:DSAdress/src:TableAdress">

-----Original Message-----
From: Dominic Grandmont [mailto:Click here to reveal e-mail address]
Sent: Tuesday, July 23, 2002 3:18 PM
To: aspngwebcontrols
Subject: [aspngwebcontrols] Please help me!!!

Please help me!!!

I'm just trying to learn XSLT. I want to use XSLT to transform my XML data
to be able to use the IE Treeview webcontrol. What I've done is that:

1- Transformed my dataset into XML with the command WriteXML ("filename",
XmlWriteMode.IgnoreSchema)
2- the result was that:
<?xml version="1.0" standalone="yes" ?>
<DSAdress xmlns="http://www.tempuri.org/DSAdress.xsd";>
    <TableAdress>
        <id>1</id>
        <adress>http://www.here.com</adress>
    </TableAdress>
    <TableAdress>
        <id>2</id>
        <adress>http://www.there.com</adress>
    </TableAdress>
</DSAdress>

But my problem is when I want to walk through my xml file. I'm unable to
reach any child nodes. There's only the slash "/" that worked. Everything
else gave me error like: "There is invalid data at the root level 1". I
tried with an XML file that didn't contained an inline schema and it worked.
But when you use the WriteXML method, VS put a namespace in my xml file. Is
it the reason why it doesn't work? This is my XSLT. Please help me.

Domgrant
---------

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version='1.0' >
    <xsl:template match="/">
        <TREENODES>
            <!--<treenode Text="TableAdress" >-->
                <xsl:for-each select="DSAdress/TableAdress">
                    <xsl:element name="treenode">
                        <xsl:attribute name="DefaultStyle">background:#CCFF66;border:solid
1px;color:blue;font-size:9pt</xsl:attribute>
                        <xsl:attribute
name="HoverStyle">background:#FF66CC;color:brown;font-name;Arial</xsl:attrib
ute>
                        <xsl:attribute
name="SelectedStyle">color:red;font-name=Tahoma;font-weight:bold-italic</xsl
:attribute>
                        <xsl:attribute name="Text" >Will It work <xsl:value-of
select="DSAdress/TableAdress/id"/></xsl:attribute>
                        <xsl:attribute name="Target" >_blank</xsl:attribute>
                    </xsl:element>
                </xsl:for-each>
            <!--</treenode>-->
        </TREENODES>
    </xsl:template>
</xsl:stylesheet>

---------

_________________________________________________________________
Affichez, modifiez et partagez gratuitement vos photos en ligne:
http://photos.msn.com/support/worldwide.aspx

| [aspngwebcontrols] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngwebcontrols.asp = JOIN/QUIT

| [aspngwebcontrols] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngwebcontrols.asp = JOIN/QUIT

Reply to this message...
 
 
System.Data.XmlWriteMode




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification