I'm trying to use aurigadoc 1.4b with ant.
I can use the aurigadoc.bat file to generate my html.
I can use the following target in ant also
<target name="gen.2">
<java
classname="com.aurigalogic.aurigadoc.cmdline.Converter"
fork="true" classpathref="path">
<arg line="-html -XML
development-practices.xml -OUT
development-practices.html" />
</java>
</target>
But, when I try to use the <aurigadoc> target, I get
the following error:
Path contains invalid character: \
I had to load the source of aurigadoc into eclipse to
find the problem. It happens in
com.aurigalogic.aurigadoc.util.Util.mergeDocument() on
the following line:
Document doc = builder.build(fileName);
Apparently, the xom version of this builder does not
like a path like
C:\workspaces-eclipse\GTA\documentation\doc\doc.xml
The builder throws the following exception when it
tries to parse the document:
[aurigadoc]
com.sun.org.apache.xerces.internal.util.URI$MalformedURIException:
Path contains invalid character: \
[aurigadoc] at
com.sun.org.apache.xerces.internal.util.URI.initializePath(URI.java:958)
[aurigadoc] at
com.sun.org.apache.xerces.internal.util.URI.initialize(URI.java:566)
[aurigadoc] at
com.sun.org.apache.xerces.internal.util.URI.<init>(URI.java:322)
[aurigadoc] at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.expandSystemId(XMLEntityManager.java:1696)
[aurigadoc] at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:959)
[aurigadoc] at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:905)
[aurigadoc] at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDocumentEntity(XMLEntityManager.java:858)
[aurigadoc] at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.setInputSource(XMLDocumentScannerImpl.java:279)
[aurigadoc] at
com.sun.org.apache.xerces.internal.parsers.DTDConfiguration.parse(DTDConfiguration.java:511)
[aurigadoc] at
com.sun.org.apache.xerces.internal.parsers.DTDConfiguration.parse(DTDConfiguration.java:593)
[aurigadoc] at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
[aurigadoc] at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
[aurigadoc] at nu.xom.Builder.build(Unknown Source)
[aurigadoc] at nu.xom.Builder.build(Unknown Source)
[aurigadoc] at
com.aurigalogic.aurigadoc.util.Util.mergeDocument(Util.java:123)
This happens on JDK 1.5
I then modified Util.mergeDocument() to replace '\'
with '/' using this line
String replacedFileName = fileName.replaceAll("\\\\",
"/");
and I passed the new file name into the builder.build()
call.
The builder then throws the following exception when it
tries to parse the document:
[aurigadoc] java.io.FileNotFoundException:
C:\workspaces-eclipse\GTA\documentation\C:\workspaces-eclipse\GTA\documentation\doc\doc.xml
(The filename, directory name, or volume label syntax
is incorrect)
[aurigadoc] at java.io.FileInputStream.open(Native
Method)
[aurigadoc] at
java.io.FileInputStream.<init>(FileInputStream.java:106)
[aurigadoc] at
java.io.FileInputStream.<init>(FileInputStream.java:66)
[aurigadoc] at
sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70)
[aurigadoc] at
sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161)
[aurigadoc] at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:973)
[aurigadoc] at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:905)
[aurigadoc] at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDocumentEntity(XMLEntityManager.java:858)
[aurigadoc] at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.setInputSource(XMLDocumentScannerImpl.java:279)
[aurigadoc] at
com.sun.org.apache.xerces.internal.parsers.DTDConfiguration.parse(DTDConfiguration.java:511)
[aurigadoc] at
com.sun.org.apache.xerces.internal.parsers.DTDConfiguration.parse(DTDConfiguration.java:593)
[aurigadoc] at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
[aurigadoc] at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
[aurigadoc] at nu.xom.Builder.build(Unknown Source)
[aurigadoc] at nu.xom.Builder.build(Unknown Source)
[aurigadoc] at
com.aurigalogic.aurigadoc.util.Util.mergeDocument(Util.java:123)
Somehow, it mangles the filename.
On JDK 1.4, it is a different problem.
If the filename has backslashes or forward slashes, I
get the same exception:
[aurigadoc] nu.xom.ParsingException: File
"C:\workspaces-eclipse\aurigadoc\documentation\doc\doc.xml"
not found. at line 0, column 0.
[aurigadoc] at nu.xom.Builder.build(Unknown Source)
[aurigadoc] at nu.xom.Builder.build(Unknown Source)
[aurigadoc] at
com.aurigalogic.aurigadoc.util.Util.mergeDocument(Util.java:123)
The file does exist though, as it works with the gen.2
target I pasted in at the top.
I've attached this bug report ( in case it isn't
formatted very well after being submitted ) along with
my files in the zipped attachment.
build.xml, bugreport, and source files