Output not obtained
-
Hi... when I apply xsl transformation, no output is obtained. Can anyone help me? My xml file is --------------------- <?xml version="1.0" encoding="utf-8"?> <Data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySpace>Testing</MySpace> </Data> --------------------- My xslt file is ----------------------- <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text" indent="yes"/> <xsl:template match="/"> <value-of select="MySpace"/> </xsl:template> </xsl:stylesheet> ----------------------- Thanks Fadi
-
Hi... when I apply xsl transformation, no output is obtained. Can anyone help me? My xml file is --------------------- <?xml version="1.0" encoding="utf-8"?> <Data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySpace>Testing</MySpace> </Data> --------------------- My xslt file is ----------------------- <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text" indent="yes"/> <xsl:template match="/"> <value-of select="MySpace"/> </xsl:template> </xsl:stylesheet> ----------------------- Thanks Fadi
-
Fadi Yoosuf wrote:
when I apply xsl transformation, no output is obtained.
When you apply it how? In what context?
You can paste the xml and xslt I gave in w3schools' xslt tester. I have pasted the link below http://www.w3schools.com/xsl/tryxslt.asp?xmlfile=cdcatalog&xsltfile=cdcatalog[^] thanks fadi
-
You can paste the xml and xslt I gave in w3schools' xslt tester. I have pasted the link below http://www.w3schools.com/xsl/tryxslt.asp?xmlfile=cdcatalog&xsltfile=cdcatalog[^] thanks fadi
-
Fadi, the bad news is you don't appear to have the requisite knowledge of the technologies you are working with to be attempting this task. A Web Browser is only going to display HTML.
Thanks alot for the effective criticism. I overestimated (mistook) like the system had the facility to convert xml/text formats to html. Anyway "alerted hereafter" :) thanks Fadi
-
Fadi, the bad news is you don't appear to have the requisite knowledge of the technologies you are working with to be attempting this task. A Web Browser is only going to display HTML.
Led, You argued like "A Web Browser is only going to display HTML." Was it a blind response? When you get time, make an html file, open it in edit mode and paste plain text in that. Try viewing in a browser and you can still see the plain text (which was written without html markups). Now try creating another .html file and paste some xml conent in that. Try viewing in a browser and you can still see the innertext of html nodes in a non formatted manner. Can you pls. explain the reason for this w.r.t. your argument?? Also can you try the default xml given in http://www.w3schools.com/xsl/tryxslt.asp?xmlfile=cdcatalog&xsltfile=cdcatalog[^]. Just change the xslt content as follows ---------------------------- <?xml version="1.0" encoding="ISO-8859-1"?> <!-- Edited by XMLSpy® --> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text"/> <xsl:template match="/"> <xsl:for-each select="catalog/cd"> <xsl:value-of select="title"/> <xsl:value-of select="artist"/> </xsl:for-each> </xsl:template> </xsl:stylesheet> ---------------------------- Now can you pls explain why the output is displayed in the browser even if it is in text format?? If you find a solution, can you pls. explain what is wrong with my code in the first post?? Sorry for disturbing you again It would be nice of you, if you can convince me with a good answer Thanks Fadi
-
Hi... when I apply xsl transformation, no output is obtained. Can anyone help me? My xml file is --------------------- <?xml version="1.0" encoding="utf-8"?> <Data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySpace>Testing</MySpace> </Data> --------------------- My xslt file is ----------------------- <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text" indent="yes"/> <xsl:template match="/"> <value-of select="MySpace"/> </xsl:template> </xsl:stylesheet> ----------------------- Thanks Fadi
The "MySpace" element is not the child of the root node as indicated in:
<xsl:template match="/">
. Also, "value-of" needs to be "xsl:value-of"."We make a living by what we get, we make a life by what we give." --Winston Churchill
modified on Monday, June 1, 2009 2:12 PM
-
Led, You argued like "A Web Browser is only going to display HTML." Was it a blind response? When you get time, make an html file, open it in edit mode and paste plain text in that. Try viewing in a browser and you can still see the plain text (which was written without html markups). Now try creating another .html file and paste some xml conent in that. Try viewing in a browser and you can still see the innertext of html nodes in a non formatted manner. Can you pls. explain the reason for this w.r.t. your argument?? Also can you try the default xml given in http://www.w3schools.com/xsl/tryxslt.asp?xmlfile=cdcatalog&xsltfile=cdcatalog[^]. Just change the xslt content as follows ---------------------------- <?xml version="1.0" encoding="ISO-8859-1"?> <!-- Edited by XMLSpy® --> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text"/> <xsl:template match="/"> <xsl:for-each select="catalog/cd"> <xsl:value-of select="title"/> <xsl:value-of select="artist"/> </xsl:for-each> </xsl:template> </xsl:stylesheet> ---------------------------- Now can you pls explain why the output is displayed in the browser even if it is in text format?? If you find a solution, can you pls. explain what is wrong with my code in the first post?? Sorry for disturbing you again It would be nice of you, if you can convince me with a good answer Thanks Fadi
Fadi Yoosuf wrote:
Now can you pls explain why the output is displayed in the browser even if it is in text format??
It's not displayed in my browser. That is why I posted what I did and it's as far as I got in debugging your error. I was wrong. Thankfully George Jackson has backed me up and hopefully provided you with the solution. [modified] What is wrong with this post? You asked me to explain and I did?
-
The "MySpace" element is not the child of the root node as indicated in:
<xsl:template match="/">
. Also, "value-of" needs to be "xsl:value-of"."We make a living by what we get, we make a life by what we give." --Winston Churchill
modified on Monday, June 1, 2009 2:12 PM
thank you very much George.... it is really helpful @ this situation... led, lemme thank u also for ur efforts.(but you should understand the seriousness of misguiding someone(and all who read the post) with respect to a temporary output. there were errors in my xslt. you didn't even point out that. What if I had blindly believed you!!!!!)