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!
html xml xslt
add a comment |
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!
html xml xslt
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
add a comment |
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!
html xml xslt
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
html xml xslt
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
add a comment |
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
add a comment |
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>
Awesome!!:) Thank you so much! You definitely have a good eye my friend!
– drakester21
Nov 8 at 4:00
add a comment |
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>
Awesome!!:) Thank you so much! You definitely have a good eye my friend!
– drakester21
Nov 8 at 4:00
add a comment |
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>
Awesome!!:) Thank you so much! You definitely have a good eye my friend!
– drakester21
Nov 8 at 4:00
add a comment |
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>
Replace
<td><xsl:value-of select="engine/fuel system"/></td>
with
<td><xsl:value-of select="engine/fuel_system"/></td>
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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