Discussions

XML & Web services: XSL

  1. XSL (1 messages)

    Hi All,

    I know that XSLT is the most important part of the XSL Standards. It is the part of XSL that is used to transform an XML document into another XML document, or another type of document that is recognized by a browser, like HTML and XHTML.

    BUT CAN I CONVERT XML TO JAVA CLASSES USING XSL or XSLT ?

    Ragards
    Sabyasachi Chowdhury

    Threaded Messages (1)

  2. XSL[ Go to top ]

    Hi Sabyasachi,

    I think this might be possible, but it is definitely not the best way to produce Java code from XML. You should take a look at XML-Binding technologies like JAXB or Castor. With that you can produce Java code that is equivalent to a given XML schema or DTD document.

    So if you have an XML schema (or DTD) that defines the structure of you XML, you can easily produce Java code by applying the API given by one of the technologies mentioned above.

    URLs are:
    JAXB: http://java.sun.com/xml/jaxb/
    Castor: http://castor.exolab.org/

    I recommend JAXB, since Castor does not comply to the latest XML schema specification (as far as I know).

    Cheers,
    Kristian