Create a XSLT sheet from a XSL document? Not working? Done both the XLT doc and XLS Stylesheet











up vote
0
down vote

favorite












Hello I am trying to put my XML document elements into a table format using the XSLT style sheet approach.



XML Document






<?xml version="1.0"?>
<?xml-stylesheet href="Assignment2.xsl" type="text/xsl"?>
<cars orderid="199564"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="Assignment1.xsd">
<make>Chevy</make>
<model>Colorado</model>
<year>2017</year>
<color>Silver</color>
<engine>
<number_of_cylinders>6</number_of_cylinders>
<fuel_system>fuel injected</fuel_system>
</engine>
<number_of_doors>4</number_of_doors>
<transmission_type>automatic</transmission_type>
<accessories>
<number_of_cylinders>8</number_of_cylinders>
<fuel_system>fuel injected</fuel_system>
</accessories>
</cars>





XLS Stylesheet(which contains the table format)






<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
<html>
<body>
<h2> Car Information </h2>

<table border="1">
<tr>
<th> Make</th>
<th> Model> </th>
<th> Year </th>
<th> Color </th>
<th> No. of Cylinders </th>
<th> Fuel_System </th>
<th> Number of Doors </th>
<th> Transmission Type </th>
</tr>

<xsl:for-each select="cars">
<tr>
<td><xsl:value-of select="make"/></td>
<td><xsl:value-of select="model"/></td>
<td><xsl:value-of select="year"/></td>
<td><xsl:value-of select="color"/></td>
<td><xsl:value-of select="engine/number_of_cylinders"/></td>
<td><xsl:value-of select="engine/fuel system"/></td>
<td><xsl:value-of select="number_of_doors"/></td>
<td><xsl:value-of select="transmission_type"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>


</xsl:template>
</xsl:stylesheet>





I watched this Youtube video https://www.youtube.com/watch?v=BujLy71JY1k over how to create XSLT in under 5 mins. I seen where the guy linked the XLS stylesheet file to the XML within the XML file itself. At first I thought I missed this part so I went back and tried it and it did't fixes the problem. I could be wrong on this but I believe both my XML Document and XLS file are both formatted correct and done right. What step or steps am I missing here??



P.S. I don't think it makes much of a difference but I have both the XLS stylesheet file and the XML document file in the same directory on my desktop.



When I try to load the XML file I keep getting this error messageXML Error loading stylesheet: X Path parse failure: operator expected message



Location of the files path =(C:UsersDrakeDesktopExercise 7.4)



Location of the XML and XLS Stylesheet file



Thank you for your feedback Drake!










share|improve this question
























  • I recommend using xsltfiddle.liberty-development.net to test your XSLT, as this will give you better error messages. See xsltfiddle.liberty-development.net/pPqsHUp for you case, where it shows the actual line number in error.
    – Tim C
    Nov 8 at 8:53















up vote
0
down vote

favorite












Hello I am trying to put my XML document elements into a table format using the XSLT style sheet approach.



XML Document






<?xml version="1.0"?>
<?xml-stylesheet href="Assignment2.xsl" type="text/xsl"?>
<cars orderid="199564"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="Assignment1.xsd">
<make>Chevy</make>
<model>Colorado</model>
<year>2017</year>
<color>Silver</color>
<engine>
<number_of_cylinders>6</number_of_cylinders>
<fuel_system>fuel injected</fuel_system>
</engine>
<number_of_doors>4</number_of_doors>
<transmission_type>automatic</transmission_type>
<accessories>
<number_of_cylinders>8</number_of_cylinders>
<fuel_system>fuel injected</fuel_system>
</accessories>
</cars>





XLS Stylesheet(which contains the table format)






<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
<html>
<body>
<h2> Car Information </h2>

<table border="1">
<tr>
<th> Make</th>
<th> Model> </th>
<th> Year </th>
<th> Color </th>
<th> No. of Cylinders </th>
<th> Fuel_System </th>
<th> Number of Doors </th>
<th> Transmission Type </th>
</tr>

<xsl:for-each select="cars">
<tr>
<td><xsl:value-of select="make"/></td>
<td><xsl:value-of select="model"/></td>
<td><xsl:value-of select="year"/></td>
<td><xsl:value-of select="color"/></td>
<td><xsl:value-of select="engine/number_of_cylinders"/></td>
<td><xsl:value-of select="engine/fuel system"/></td>
<td><xsl:value-of select="number_of_doors"/></td>
<td><xsl:value-of select="transmission_type"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>


</xsl:template>
</xsl:stylesheet>





I watched this Youtube video https://www.youtube.com/watch?v=BujLy71JY1k over how to create XSLT in under 5 mins. I seen where the guy linked the XLS stylesheet file to the XML within the XML file itself. At first I thought I missed this part so I went back and tried it and it did't fixes the problem. I could be wrong on this but I believe both my XML Document and XLS file are both formatted correct and done right. What step or steps am I missing here??



P.S. I don't think it makes much of a difference but I have both the XLS stylesheet file and the XML document file in the same directory on my desktop.



When I try to load the XML file I keep getting this error messageXML Error loading stylesheet: X Path parse failure: operator expected message



Location of the files path =(C:UsersDrakeDesktopExercise 7.4)



Location of the XML and XLS Stylesheet file



Thank you for your feedback Drake!










share|improve this question
























  • I recommend using xsltfiddle.liberty-development.net to test your XSLT, as this will give you better error messages. See xsltfiddle.liberty-development.net/pPqsHUp for you case, where it shows the actual line number in error.
    – Tim C
    Nov 8 at 8:53













up vote
0
down vote

favorite









up vote
0
down vote

favorite











Hello I am trying to put my XML document elements into a table format using the XSLT style sheet approach.



XML Document






<?xml version="1.0"?>
<?xml-stylesheet href="Assignment2.xsl" type="text/xsl"?>
<cars orderid="199564"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="Assignment1.xsd">
<make>Chevy</make>
<model>Colorado</model>
<year>2017</year>
<color>Silver</color>
<engine>
<number_of_cylinders>6</number_of_cylinders>
<fuel_system>fuel injected</fuel_system>
</engine>
<number_of_doors>4</number_of_doors>
<transmission_type>automatic</transmission_type>
<accessories>
<number_of_cylinders>8</number_of_cylinders>
<fuel_system>fuel injected</fuel_system>
</accessories>
</cars>





XLS Stylesheet(which contains the table format)






<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
<html>
<body>
<h2> Car Information </h2>

<table border="1">
<tr>
<th> Make</th>
<th> Model> </th>
<th> Year </th>
<th> Color </th>
<th> No. of Cylinders </th>
<th> Fuel_System </th>
<th> Number of Doors </th>
<th> Transmission Type </th>
</tr>

<xsl:for-each select="cars">
<tr>
<td><xsl:value-of select="make"/></td>
<td><xsl:value-of select="model"/></td>
<td><xsl:value-of select="year"/></td>
<td><xsl:value-of select="color"/></td>
<td><xsl:value-of select="engine/number_of_cylinders"/></td>
<td><xsl:value-of select="engine/fuel system"/></td>
<td><xsl:value-of select="number_of_doors"/></td>
<td><xsl:value-of select="transmission_type"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>


</xsl:template>
</xsl:stylesheet>





I watched this Youtube video https://www.youtube.com/watch?v=BujLy71JY1k over how to create XSLT in under 5 mins. I seen where the guy linked the XLS stylesheet file to the XML within the XML file itself. At first I thought I missed this part so I went back and tried it and it did't fixes the problem. I could be wrong on this but I believe both my XML Document and XLS file are both formatted correct and done right. What step or steps am I missing here??



P.S. I don't think it makes much of a difference but I have both the XLS stylesheet file and the XML document file in the same directory on my desktop.



When I try to load the XML file I keep getting this error messageXML Error loading stylesheet: X Path parse failure: operator expected message



Location of the files path =(C:UsersDrakeDesktopExercise 7.4)



Location of the XML and XLS Stylesheet file



Thank you for your feedback Drake!










share|improve this question















Hello I am trying to put my XML document elements into a table format using the XSLT style sheet approach.



XML Document






<?xml version="1.0"?>
<?xml-stylesheet href="Assignment2.xsl" type="text/xsl"?>
<cars orderid="199564"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="Assignment1.xsd">
<make>Chevy</make>
<model>Colorado</model>
<year>2017</year>
<color>Silver</color>
<engine>
<number_of_cylinders>6</number_of_cylinders>
<fuel_system>fuel injected</fuel_system>
</engine>
<number_of_doors>4</number_of_doors>
<transmission_type>automatic</transmission_type>
<accessories>
<number_of_cylinders>8</number_of_cylinders>
<fuel_system>fuel injected</fuel_system>
</accessories>
</cars>





XLS Stylesheet(which contains the table format)






<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
<html>
<body>
<h2> Car Information </h2>

<table border="1">
<tr>
<th> Make</th>
<th> Model> </th>
<th> Year </th>
<th> Color </th>
<th> No. of Cylinders </th>
<th> Fuel_System </th>
<th> Number of Doors </th>
<th> Transmission Type </th>
</tr>

<xsl:for-each select="cars">
<tr>
<td><xsl:value-of select="make"/></td>
<td><xsl:value-of select="model"/></td>
<td><xsl:value-of select="year"/></td>
<td><xsl:value-of select="color"/></td>
<td><xsl:value-of select="engine/number_of_cylinders"/></td>
<td><xsl:value-of select="engine/fuel system"/></td>
<td><xsl:value-of select="number_of_doors"/></td>
<td><xsl:value-of select="transmission_type"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>


</xsl:template>
</xsl:stylesheet>





I watched this Youtube video https://www.youtube.com/watch?v=BujLy71JY1k over how to create XSLT in under 5 mins. I seen where the guy linked the XLS stylesheet file to the XML within the XML file itself. At first I thought I missed this part so I went back and tried it and it did't fixes the problem. I could be wrong on this but I believe both my XML Document and XLS file are both formatted correct and done right. What step or steps am I missing here??



P.S. I don't think it makes much of a difference but I have both the XLS stylesheet file and the XML document file in the same directory on my desktop.



When I try to load the XML file I keep getting this error messageXML Error loading stylesheet: X Path parse failure: operator expected message



Location of the files path =(C:UsersDrakeDesktopExercise 7.4)



Location of the XML and XLS Stylesheet file



Thank you for your feedback Drake!






<?xml version="1.0"?>
<?xml-stylesheet href="Assignment2.xsl" type="text/xsl"?>
<cars orderid="199564"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="Assignment1.xsd">
<make>Chevy</make>
<model>Colorado</model>
<year>2017</year>
<color>Silver</color>
<engine>
<number_of_cylinders>6</number_of_cylinders>
<fuel_system>fuel injected</fuel_system>
</engine>
<number_of_doors>4</number_of_doors>
<transmission_type>automatic</transmission_type>
<accessories>
<number_of_cylinders>8</number_of_cylinders>
<fuel_system>fuel injected</fuel_system>
</accessories>
</cars>





<?xml version="1.0"?>
<?xml-stylesheet href="Assignment2.xsl" type="text/xsl"?>
<cars orderid="199564"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="Assignment1.xsd">
<make>Chevy</make>
<model>Colorado</model>
<year>2017</year>
<color>Silver</color>
<engine>
<number_of_cylinders>6</number_of_cylinders>
<fuel_system>fuel injected</fuel_system>
</engine>
<number_of_doors>4</number_of_doors>
<transmission_type>automatic</transmission_type>
<accessories>
<number_of_cylinders>8</number_of_cylinders>
<fuel_system>fuel injected</fuel_system>
</accessories>
</cars>





<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
<html>
<body>
<h2> Car Information </h2>

<table border="1">
<tr>
<th> Make</th>
<th> Model> </th>
<th> Year </th>
<th> Color </th>
<th> No. of Cylinders </th>
<th> Fuel_System </th>
<th> Number of Doors </th>
<th> Transmission Type </th>
</tr>

<xsl:for-each select="cars">
<tr>
<td><xsl:value-of select="make"/></td>
<td><xsl:value-of select="model"/></td>
<td><xsl:value-of select="year"/></td>
<td><xsl:value-of select="color"/></td>
<td><xsl:value-of select="engine/number_of_cylinders"/></td>
<td><xsl:value-of select="engine/fuel system"/></td>
<td><xsl:value-of select="number_of_doors"/></td>
<td><xsl:value-of select="transmission_type"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>


</xsl:template>
</xsl:stylesheet>





<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
<html>
<body>
<h2> Car Information </h2>

<table border="1">
<tr>
<th> Make</th>
<th> Model> </th>
<th> Year </th>
<th> Color </th>
<th> No. of Cylinders </th>
<th> Fuel_System </th>
<th> Number of Doors </th>
<th> Transmission Type </th>
</tr>

<xsl:for-each select="cars">
<tr>
<td><xsl:value-of select="make"/></td>
<td><xsl:value-of select="model"/></td>
<td><xsl:value-of select="year"/></td>
<td><xsl:value-of select="color"/></td>
<td><xsl:value-of select="engine/number_of_cylinders"/></td>
<td><xsl:value-of select="engine/fuel system"/></td>
<td><xsl:value-of select="number_of_doors"/></td>
<td><xsl:value-of select="transmission_type"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>


</xsl:template>
</xsl:stylesheet>






html xml xslt






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 8 at 3:18









Gerard

11k41737




11k41737










asked Nov 8 at 2:58









drakester21

52




52












  • I recommend using xsltfiddle.liberty-development.net to test your XSLT, as this will give you better error messages. See xsltfiddle.liberty-development.net/pPqsHUp for you case, where it shows the actual line number in error.
    – Tim C
    Nov 8 at 8:53


















  • I recommend using xsltfiddle.liberty-development.net to test your XSLT, as this will give you better error messages. See xsltfiddle.liberty-development.net/pPqsHUp for you case, where it shows the actual line number in error.
    – Tim C
    Nov 8 at 8:53
















I recommend using xsltfiddle.liberty-development.net to test your XSLT, as this will give you better error messages. See xsltfiddle.liberty-development.net/pPqsHUp for you case, where it shows the actual line number in error.
– Tim C
Nov 8 at 8:53




I recommend using xsltfiddle.liberty-development.net to test your XSLT, as this will give you better error messages. See xsltfiddle.liberty-development.net/pPqsHUp for you case, where it shows the actual line number in error.
– Tim C
Nov 8 at 8:53












1 Answer
1






active

oldest

votes

















up vote
0
down vote













Replace



<td><xsl:value-of select="engine/fuel system"/></td>


with



<td><xsl:value-of select="engine/fuel_system"/></td>





share|improve this answer





















  • Awesome!!:) Thank you so much! You definitely have a good eye my friend!
    – drakester21
    Nov 8 at 4:00











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53200919%2fcreate-a-xslt-sheet-from-a-xsl-document-not-working-done-both-the-xlt-doc-and%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













Replace



<td><xsl:value-of select="engine/fuel system"/></td>


with



<td><xsl:value-of select="engine/fuel_system"/></td>





share|improve this answer





















  • Awesome!!:) Thank you so much! You definitely have a good eye my friend!
    – drakester21
    Nov 8 at 4:00















up vote
0
down vote













Replace



<td><xsl:value-of select="engine/fuel system"/></td>


with



<td><xsl:value-of select="engine/fuel_system"/></td>





share|improve this answer





















  • Awesome!!:) Thank you so much! You definitely have a good eye my friend!
    – drakester21
    Nov 8 at 4:00













up vote
0
down vote










up vote
0
down vote









Replace



<td><xsl:value-of select="engine/fuel system"/></td>


with



<td><xsl:value-of select="engine/fuel_system"/></td>





share|improve this answer












Replace



<td><xsl:value-of select="engine/fuel system"/></td>


with



<td><xsl:value-of select="engine/fuel_system"/></td>






share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 8 at 3:51









T.N Maurya

111




111












  • Awesome!!:) Thank you so much! You definitely have a good eye my friend!
    – drakester21
    Nov 8 at 4:00


















  • Awesome!!:) Thank you so much! You definitely have a good eye my friend!
    – drakester21
    Nov 8 at 4:00
















Awesome!!:) Thank you so much! You definitely have a good eye my friend!
– drakester21
Nov 8 at 4:00




Awesome!!:) Thank you so much! You definitely have a good eye my friend!
– drakester21
Nov 8 at 4:00


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53200919%2fcreate-a-xslt-sheet-from-a-xsl-document-not-working-done-both-the-xlt-doc-and%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

Xamarin.form Move up view when keyboard appear

Post-Redirect-Get with Spring WebFlux and Thymeleaf

Anylogic : not able to use stopDelay()