Reputation: 886
/ Hell0 guys, I will try to be as specific as possible, because I came here after some time googling and you-tubing about transforming XML to XSL.. but I could not find or understand. Deal is, I got task ( btw. NEVER even touched XML or XSL ) to create a model of lets say Customer and Carrier. First step is when Customer sends an order to Carrier ( may sound stupid :) ). So using eClipse I've created
orderForCarrier.xsd
, then using website : https://devutilsonline.com/xsd-xml/generate-xml-from-xsd I've created XML file.
So now, the final task is (problem is, I am not VERY sure what I need to do) to make transformation to XSL file.
example of XML file I got generated :
<?xml version="1.0"?>
<cus:sendOrderToCarrier xmlns:cus="http://www.example.org/Customer">
<cus:customerCompanyName>
<cus:companyName>string</cus:companyName>
<cus:Name>string</cus:Name>
<cus:SurrName>string</cus:SurrName>
<cus:SSN>3</cus:SSN>
</cus:customerCompanyName>
<cus:orderDetails>string</cus:orderDetails>
</cus:sendOrderToCarrier>
As much I understand, deal is to make XSL file,so when Customer sends order to Carrier, it will get formatted in the way Carrier needs it and vise-versa.
For conclusion, it's not a homework or something like that, I am very new Java developer, but I got this monkey tasks and I am kinda stuck here, because I even dont know what I am dealing with.
So ANY help would be really great.
thanks in advance.
Upvotes: 0
Views: 233
Reputation: 57189
Though I think the comments already cover your question, let me give it a go regardless:
about transforming XML to XSL..
XSLT is a language, XML is (usually) the source. The language XSLT is written in XML. What you are asking here is like saying "how to transform a text file into C#".
My guess is: you have some kind of target format in XML and some kind of source format (maybe XML, maybe text), and you would like XSLT to transform it from source to target.
So now, the final task is (problem is, I am not VERY sure what I need to do) to make transformation to XSL file.
This is problematic: if you don't know what your task is, then it will be very hard to help you, because we really need you to explain what you want.
So using eClipse I've created
orderForCarrier.xsd
Why? What is the task here? Was this also auto-generated?
then using website : https://devutilsonline.com/xsd-xml/generate-xml-from-xsd I've created XML file.
That creates random input. It will be very hard to do anything meaningful with it. Fill it with data you actually have, or something very close to it.
As much I understand, deal is to make XSL file,so when Customer sends order to Carrier, it will get formatted in the way Carrier needs it and vise-versa.
So, the customer knows XML and will use XSLT? I assume that the expects some kind of format, but without knowing what that format is, we can't help you.
Some suggestions:
Happy coding! For each step above there are many paid and unpaid tutorials online. But like any other language out there, it takes time to master it, so give yourself that time, stay away from auto-generation, and do it step by step.
Upvotes: 1