create xsl styleshet using java code

Discussion in 'Java' started by rjl444@hotmail.com, Jan 9, 2005.

  1. Guest

    I am familier with jdom creating XML file. What I need to do is to
    create XSL stylesheet instead of xml. is there any classes for this? My
    app will create XSL file based on user input of nodes.
    thanks
    joe
    , Jan 9, 2005
    #1
    1. Advertising

  2. Harish Guest

    an xsl is also an xml file, correct?
    so whats stopping you from generating the xsl file?

    <> wrote in message
    news:...
    >I am familier with jdom creating XML file. What I need to do is to
    > create XSL stylesheet instead of xml. is there any classes for this? My
    > app will create XSL file based on user input of nodes.
    > thanks
    > joe
    >
    Harish, Jan 12, 2005
    #2
    1. Advertising

  3. Guest

    it is saying <xsl:whatever> is invalid.
    , Jan 13, 2005
    #3
  4. Guest

    Use the org.jdom.Namespace class as in:


    import java.io_OutputStream;
    import org.jdom.Document;
    import org.jdom.Element;
    import org.jdom.Namespace;
    import org.jdom.output.Format;
    import org.jdom.output.XMLOutputter;

    public class C {
    public static void main(String[] args) {
    Namespace xsl = Namespace.getNamespace("xsl",
    "http://www.w3.org/1999/XSL/Transform");
    Element root = new Element("stylesheet", xsl);
    Element template = new Element("template", xsl);
    template.setAttribute("match", "/");
    root.addContent(template);
    Document doc = new Document(root);
    try {
    XMLOutputter serializer = new
    XMLOutputter(Format.getPrettyFormat());
    serializer.output(doc, (OutputStream)System.out);
    }
    catch (Exception ex) {
    ex.printStackTrace();
    }
    }
    }
    , Jan 14, 2005
    #4
  5. Guest

    thanks alot for the help.
    , Jan 23, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Thomas S.

    XSL: textarea with xsl code???

    Thomas S., Feb 5, 2004, in forum: XML
    Replies:
    1
    Views:
    1,130
    Markus Spath
    Feb 5, 2004
  2. Replies:
    1
    Views:
    3,573
    A. Bolmarcich
    May 27, 2005
  3. Replies:
    2
    Views:
    9,238
    Martin Honnen
    Sep 5, 2006
  4. Elena
    Replies:
    0
    Views:
    849
    Elena
    May 3, 2007
  5. Elena
    Replies:
    0
    Views:
    1,306
    Elena
    May 3, 2007
Loading...

Share This Page