Skip to Content.
Sympa Menu

xom-interest - RE: [XOM-interest] XOM problem with servlets

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Sebastien Brissaud <sebastien AT inovo.be>
  • To: <xom-interest AT lists.ibiblio.org>
  • Subject: RE: [XOM-interest] XOM problem with servlets
  • Date: Tue, 8 Apr 2003 10:38:02 +0200

Builder.build(String) and Builder.build(File) automaticaly prefix the
absolute path of the file with "file://" but for windows path it should
better prefix with "file:///"

In your case instead of parser.build(fileName), you can use build(new
FileInputStream(fileName), "file:///"+fileName)

Sebastien

> -----Original Message-----
> From: xom-interest-bounces AT lists.ibiblio.org
[mailto:xom-interest-bounces AT lists.ibiblio.org] On
> Behalf Of Nils_Kilden-Pedersen AT Countrywide.Com
> Sent: Monday, April 07, 2003 11:51 PM
> To: xom-interest AT lists.ibiblio.org
> Subject: Re: [XOM-interest] XOM problem with servlets
>
> Shouldn't you filename be:
> "file://C:/temp/wurfl.xml" ?
> It believes that c: is the protocol.
>
>
>
>
>
> "luca passani" <passani AT eunet.no>
> Sent by: xom-interest-bounces AT lists.ibiblio.org
> 04/07/2003 02:39 PM
>
>
> To: xom <xom-interest AT lists.ibiblio.org>
> cc:
> Subject: [XOM-interest] XOM problem with servlets
>
>
> Elliotte,
>
> I am working on the WURFL library. What I see is that while I can use
XOM
> no problem in a command line test application, I get an error when I
> start the parsing
> from within a servlet:
>
> Here is the servlet line that gives a problem,
>
> UAManager uam = ObjectsManager.getUAManagerInstance();
>
> which invokes:
>
> public static UAManager getUAManagerInstance() throws IOException
{
> synchronized (lock) {
> if (wurflInstance==null)
> wurflInstance = new Wurfl ();
> if (UAManagerInstance==null)
> UAManagerInstance = new UAManager(wurflInstance);
> return UAManagerInstance;
> }
> }
>
> which invokes:
>
>
> Wurfl() throws IOException {
> this("C:/temp/wurfl.xml");
> }
>
> which invokes:
>
> Wurfl(String fileName) throws IOException {
>
> try {
> Builder parser = new Builder();
> Document doc = parser.build(fileName);
> //System.out.println("Wurfl: parsing "+ fileName + "
> succesful!");
>
> //String rootname = root.getLocalName();
> //System.out.print(rootname);
> Element root = doc.getRootElement();
> Element devices_elem =
root.getFirstChildElement("devices");
> :
>
> here is the error I get. Any idea? thank you -luca
>
>
> java.net.MalformedURLException: unknown protocol: c
> at java.net.URL.(URL.java:586)
> at java.net.URL.(URL.java:476)
> at java.net.URL.(URL.java:425)
> at
>
org.apache.xerces.impl.XMLEntityManager.startEntity(XMLEntityManager.jav
a:807)
> at
>
org.apache.xerces.impl.XMLEntityManager.startDocumentEntity(XMLEntityMan
ager.java:753)
> at
>
org.apache.xerces.impl.XMLDocumentScannerImpl.setInputSource(XMLDocument
ScannerImpl.java:260)
> at
>
org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:4
99)
> at
>
org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:5
81)
> at
> org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
> at
>
org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java
:1175)
> at nu.xom.Builder.build(Builder.java:550)
> at nu.xom.Builder.build(Builder.java:347)
> at it.passani.wurflapi.Wurfl.(Wurfl.java:46)
> at it.passani.wurflapi.Wurfl.(Wurfl.java:99)
> at
>
it.passani.wurflapi.ObjectsManager.getUAManagerInstance(ObjectsManager.j
ava:45)
>
>
>
> _______________________________________________
> XOM-interest mailing list
> XOM-interest AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/xom-interest
>
>
>
>
>
> _______________________________________________
> XOM-interest mailing list
> XOM-interest AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/xom-interest




Archive powered by MHonArc 2.6.24.

Top of Page