Results 1 to 3 of 3
  1. #1
    xlomo is offline Member
    Join Date
    Dec 2010
    Posts
    19
    Rep Power
    0

    Default how to get the xsl file name from an xml file in java ?

    Is there in java an easy way to get the
    xml-stylesheet file name from an xml file without just searching the string ?

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: how to get the xsl file name from an xml file in java ?

    I'm no pro at this, but does an XML document absolutely have to embed the name of its XSL file within itself? And how are you processing your XML file? JAXB?

  3. #3
    xlomo is offline Member
    Join Date
    Dec 2010
    Posts
    19
    Rep Power
    0

    Default Re: how to get the xsl file name from an xml file in java ?

    Not necessarily but I am interested in those that do embed the name of the xsl, for now i use StAX to load the xml into a Jtree.

    FileInputStream inputStream = new FileInputStream(file);
    XMLInputFactory inputFactory = XMLInputFactory.newInstance();
    XMLStreamReader reader = inputFactory.createXMLStreamReader(inputStream);

    However I wouldn't mind to use something else if needed, in order to get the xsl file name.

    well... obviously i am not a pro either.

Similar Threads

  1. Replies: 1
    Last Post: 07-28-2011, 07:50 PM
  2. java file reader, jgrasp can't find the file
    By aramiky818 in forum New To Java
    Replies: 3
    Last Post: 04-22-2011, 02:06 AM
  3. how to split large xml file into small xml file in java
    By enggvijaysingh@gmail.com in forum XML
    Replies: 2
    Last Post: 02-07-2011, 09:34 AM
  4. To open an image file such as Jpeg file using JAva Program
    By itmani2020 in forum Advanced Java
    Replies: 10
    Last Post: 07-11-2008, 09:57 AM
  5. Replies: 7
    Last Post: 05-23-2008, 03:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •