IllegalArgumentException in 5.2.3 #184

Closed
opened 2024-07-08 23:39:44 +02:00 by ToshihikoMakita · 17 comments
ToshihikoMakita commented 2024-07-08 23:39:44 +02:00 (Migrated from github.com)

When I use 5.2.3 with Saxon, I got the IllegalArgumentException shown below. This prevents to upgrade Saxon to 12.5.

PS D:\My_Documents\XML2021\NKBJ\proj\ymc-xml-to-pdf> .\build-db2db.ps1 D:\My_Documents\XML2021\NKBJ\docs\2024-04-18-mc-data\sm\SBBVT0T\xmllist\SBBVT0T-Deployment-Flat.xml  D:\My_Documents\XML2021\NKBJ\docs\2024-04-18-mc-data\sm\SBBVT0T\xmllist\SBBVT0T-expand.xml SM C:/PROGRA~1/Java/jdk-17.0.3.1  D:\My_Documents/Java/SaxonPE12-5J/saxon-pe-12.5.jar
Start expanding entities in XML file
Input file: D:/My_Documents/XML2021/NKBJ/docs/2024-04-18-mc-data/sm/SBBVT0T/xmllist/SBBVT0T-Deployment-Flat.xml
Output file: D:/My_Documents/XML2021/NKBJ/docs/2024-04-18-mc-data/sm/SBBVT0T/xmllist/SBBVT0T-expand.xml
java.lang.IllegalArgumentException: Illegal character in path at index 2: ..\master\glossary\gls.ent
        at java.base/java.net.URI.create(URI.java:906)
        at java.base/java.net.URI.resolve(URI.java:1089)
        at org.xmlresolver.Resolver.openConnection(Resolver.java:250)
        at org.xmlresolver.Resolver.resolveEntity(Resolver.java:204)
        at net.sf.saxon.lib.CatalogResourceResolver.resolveEntity(CatalogResourceResolver.java:194)
        at net.sf.saxon.lib.EntityResolverWrappingResourceResolver.resolveEntity(EntityResolverWrappingResourceResolver.java:46)
        at java.xml/com.sun.org.apache.xerces.internal.util.EntityResolver2Wrapper.resolveEntity(EntityResolver2Wrapper.java:178)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLEntityManager.resolveEntityAsPerStax(XMLEntityManager.java:1026)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:1307)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.startPE(XMLDTDScannerImpl.java:732)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.skipSeparator(XMLDTDScannerImpl.java:2101)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanDecls(XMLDTDScannerImpl.java:2064)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanDTDInternalSubset(XMLDTDScannerImpl.java:356)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(XMLDocumentScannerImpl.java:1091)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(XMLDocumentScannerImpl.java:1040)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:917)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:542)     
        at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:889)
        at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:825)
        at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
        at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1224)
        at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:637)
        at net.sf.saxon.resource.ActiveSAXSource.deliver(ActiveSAXSource.java:192)
        at net.sf.saxon.resource.ActiveStreamSource.deliver(ActiveStreamSource.java:73)
        at net.sf.saxon.event.Sender.send(Sender.java:104)
        at net.sf.saxon.Configuration.buildDocumentTree(Configuration.java:4273)
        at net.sf.saxon.s9api.DocumentBuilder.build(DocumentBuilder.java:334)
        at net.sf.saxon.Transform.processFile(Transform.java:1361)
        at net.sf.saxon.Transform.doTransform(Transform.java:894)
        at net.sf.saxon.Transform.main(Transform.java:84)
Caused by: java.net.URISyntaxException: Illegal character in path at index 2: ..\master\glossary\gls.ent
        at java.base/java.net.URI$Parser.fail(URI.java:2974)
        at java.base/java.net.URI$Parser.checkChars(URI.java:3145)
        at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3227)
        at java.base/java.net.URI$Parser.parse(URI.java:3186)
        at java.base/java.net.URI.<init>(URI.java:623)
        at java.base/java.net.URI.create(URI.java:904)
        ... 31 more
Fatal error during transformation: java.lang.IllegalArgumentException: Illegal character in path at index 2: ..\master\glossary\gls.ent

XSLT processing return code: 2
PS D:\My_Documents\XML2021\NKBJ\proj\ymc-xml-to-pdf>

We got the normal result in 4.4.0

PS D:\My_Documents\XML2021\NKBJ\proj\ymc-xml-to-pdf> .\build-db2db.ps1 D:\My_Documents\XML2021\NKBJ\docs\2024-04-18-mc-data\sm\SBBVT0T\xmllist\SBBVT0T-Deployment-Flat.xml  D:\My_Documents\XML2021\NKBJ\docs\2024-04-18-mc-data\sm\SBBVT0T\xmllist\SBBVT0T-expand.xml SM C:/PROGRA~1/Java/jdk-17.0.3.1  D:\My_Documents/Java/SaxonPE12-5J/saxon-pe-12.5.jar
Start expanding entities in XML file
Input file: D:/My_Documents/XML2021/NKBJ/docs/2024-04-18-mc-data/sm/SBBVT0T/xmllist/SBBVT0T-Deployment-Flat.xml
Output file: D:/My_Documents/XML2021/NKBJ/docs/2024-04-18-mc-data/sm/SBBVT0T/xmllist/SBBVT0T-expand.xml

XSLT processing return code: 0
Processing takes 0 minutes  1 seconds.

Job ended at 2024/07/08 15:55:58

I attached gls.ent file for your investigation.

gls.zip

I also attached the PS script. I used it in Windows 11.

build-db2db.zip

Regards,

When I use 5.2.3 with Saxon, I got the IllegalArgumentException shown below. This prevents to upgrade Saxon to 12.5. ``` PS D:\My_Documents\XML2021\NKBJ\proj\ymc-xml-to-pdf> .\build-db2db.ps1 D:\My_Documents\XML2021\NKBJ\docs\2024-04-18-mc-data\sm\SBBVT0T\xmllist\SBBVT0T-Deployment-Flat.xml D:\My_Documents\XML2021\NKBJ\docs\2024-04-18-mc-data\sm\SBBVT0T\xmllist\SBBVT0T-expand.xml SM C:/PROGRA~1/Java/jdk-17.0.3.1 D:\My_Documents/Java/SaxonPE12-5J/saxon-pe-12.5.jar Start expanding entities in XML file Input file: D:/My_Documents/XML2021/NKBJ/docs/2024-04-18-mc-data/sm/SBBVT0T/xmllist/SBBVT0T-Deployment-Flat.xml Output file: D:/My_Documents/XML2021/NKBJ/docs/2024-04-18-mc-data/sm/SBBVT0T/xmllist/SBBVT0T-expand.xml java.lang.IllegalArgumentException: Illegal character in path at index 2: ..\master\glossary\gls.ent at java.base/java.net.URI.create(URI.java:906) at java.base/java.net.URI.resolve(URI.java:1089) at org.xmlresolver.Resolver.openConnection(Resolver.java:250) at org.xmlresolver.Resolver.resolveEntity(Resolver.java:204) at net.sf.saxon.lib.CatalogResourceResolver.resolveEntity(CatalogResourceResolver.java:194) at net.sf.saxon.lib.EntityResolverWrappingResourceResolver.resolveEntity(EntityResolverWrappingResourceResolver.java:46) at java.xml/com.sun.org.apache.xerces.internal.util.EntityResolver2Wrapper.resolveEntity(EntityResolver2Wrapper.java:178) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLEntityManager.resolveEntityAsPerStax(XMLEntityManager.java:1026) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:1307) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.startPE(XMLDTDScannerImpl.java:732) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.skipSeparator(XMLDTDScannerImpl.java:2101) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanDecls(XMLDTDScannerImpl.java:2064) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanDTDInternalSubset(XMLDTDScannerImpl.java:356) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(XMLDocumentScannerImpl.java:1091) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(XMLDocumentScannerImpl.java:1040) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:917) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:542) at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:889) at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:825) at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1224) at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:637) at net.sf.saxon.resource.ActiveSAXSource.deliver(ActiveSAXSource.java:192) at net.sf.saxon.resource.ActiveStreamSource.deliver(ActiveStreamSource.java:73) at net.sf.saxon.event.Sender.send(Sender.java:104) at net.sf.saxon.Configuration.buildDocumentTree(Configuration.java:4273) at net.sf.saxon.s9api.DocumentBuilder.build(DocumentBuilder.java:334) at net.sf.saxon.Transform.processFile(Transform.java:1361) at net.sf.saxon.Transform.doTransform(Transform.java:894) at net.sf.saxon.Transform.main(Transform.java:84) Caused by: java.net.URISyntaxException: Illegal character in path at index 2: ..\master\glossary\gls.ent at java.base/java.net.URI$Parser.fail(URI.java:2974) at java.base/java.net.URI$Parser.checkChars(URI.java:3145) at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3227) at java.base/java.net.URI$Parser.parse(URI.java:3186) at java.base/java.net.URI.<init>(URI.java:623) at java.base/java.net.URI.create(URI.java:904) ... 31 more Fatal error during transformation: java.lang.IllegalArgumentException: Illegal character in path at index 2: ..\master\glossary\gls.ent XSLT processing return code: 2 PS D:\My_Documents\XML2021\NKBJ\proj\ymc-xml-to-pdf> ``` We got the normal result in 4.4.0 ``` PS D:\My_Documents\XML2021\NKBJ\proj\ymc-xml-to-pdf> .\build-db2db.ps1 D:\My_Documents\XML2021\NKBJ\docs\2024-04-18-mc-data\sm\SBBVT0T\xmllist\SBBVT0T-Deployment-Flat.xml D:\My_Documents\XML2021\NKBJ\docs\2024-04-18-mc-data\sm\SBBVT0T\xmllist\SBBVT0T-expand.xml SM C:/PROGRA~1/Java/jdk-17.0.3.1 D:\My_Documents/Java/SaxonPE12-5J/saxon-pe-12.5.jar Start expanding entities in XML file Input file: D:/My_Documents/XML2021/NKBJ/docs/2024-04-18-mc-data/sm/SBBVT0T/xmllist/SBBVT0T-Deployment-Flat.xml Output file: D:/My_Documents/XML2021/NKBJ/docs/2024-04-18-mc-data/sm/SBBVT0T/xmllist/SBBVT0T-expand.xml XSLT processing return code: 0 Processing takes 0 minutes 1 seconds. Job ended at 2024/07/08 15:55:58 ``` I attached gls.ent file for your investigation. [gls.zip](https://github.com/user-attachments/files/16134674/gls.zip) I also attached the PS script. I used it in Windows 11. [build-db2db.zip](https://github.com/user-attachments/files/16134685/build-db2db.zip) Regards,
ndw commented 2024-07-09 09:36:27 +02:00 (Migrated from github.com)

Where does ..\master\glossary\gls.ent occur? Is it in an href attribute value or a DTD system identifier, or somewhere else? (If it's possible to send a complete test case that demonstrates the problem, that would be great.)

You say this prevents upgrading to Saxon 12.5, what version are you attempting to upgrade from?

The problem here is that \ is not a legal character in URIs, although it's obviously a perfectly legal character in Windows file names. I would have expected the resolver to change that into a / before attempting to resolve it with java.net.URI but without a test case, I can only speculate about why it isn't.

Where does `..\master\glossary\gls.ent` occur? Is it in an `href` attribute value or a DTD system identifier, or somewhere else? (If it's possible to send a complete test case that demonstrates the problem, that would be great.) You say this prevents upgrading to Saxon 12.5, what version are you attempting to upgrade *from*? The problem here is that `\` is not a legal character in URIs, although it's obviously a perfectly legal character in Windows file names. I would have expected the resolver to change that into a `/` before attempting to resolve it with `java.net.URI` but without a test case, I can only speculate about why it isn't.
ndw commented 2024-07-09 09:39:20 +02:00 (Migrated from github.com)

I'm also curious, do you have additional Java customizations? I can't find anything in Saxon or XML Resolver that would print the message Start expanding entities in XML file

I'm also curious, do you have additional Java customizations? I can't find anything in Saxon or XML Resolver that would print the message `Start expanding entities in XML file`
ToshihikoMakita commented 2024-07-10 21:54:31 +02:00 (Migrated from github.com)

Sorry for the late reply.
The customer is planning to upgrade Saxon 12.0 to Saxon 12.5.
I attached small input file to reproduce the problem.

SBBVT0T-Deployment-Flat-mod.zip

If you do need the DTD, I will negotiate with user because it is proprietary.
Regards,

Sorry for the late reply. The customer is planning to upgrade Saxon 12.0 to Saxon 12.5. I attached small input file to reproduce the problem. [SBBVT0T-Deployment-Flat-mod.zip](https://github.com/user-attachments/files/16168230/SBBVT0T-Deployment-Flat-mod.zip) If you do need the DTD, I will negotiate with user because it is proprietary. Regards,
michaelhkay commented 2024-07-17 00:25:25 +02:00 (Migrated from github.com)

When I supply the document as a source document to Saxon Transform, I get

java.lang.IllegalArgumentException: java.net.URISyntaxException: Illegal character in path at index 2: ..\master\glossary\gls.ent
	at org.xmlresolver.CatalogResolver.resolveEntity(CatalogResolver.java:292)
	at org.xmlresolver.Resolver.resolveEntity(Resolver.java:199)
	at net.sf.saxon.lib.CatalogResourceResolver.resolveEntity(CatalogResourceResolver.java:194)
	at net.sf.saxon.lib.EntityResolverWrappingResourceResolver.resolveEntity(EntityResolverWrappingResourceResolver.java:46)
	at org.apache.xerces.util.EntityResolver2Wrapper.resolveEntity(Unknown Source)
	at org.apache.xerces.impl.XMLEntityManager.resolveEntity(Unknown Source)
	at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)

So the question is, what would we expect to happen?

The XML spec says:

System identifiers (and other XML strings meant to be used as URI references) may contain characters that, according to IETF RFC 3986, must be escaped before a URI can be used to retrieve the referenced resource. The characters to be escaped are the control characters #x0 to #x1F and #x7F (most of which cannot appear in XML), space #x20, the delimiters '<' #x3C, '>' #x3E and '"' #x22, the unwise characters '{' #x7B, '}' #x7D, '|' #x7C, '' #x5C, '^' #x5E and '`' #x60, as well as all characters above #x7F.

I doubt that escaping (that is, percent-encoding) the "unwise" character "" as suggested here is going to be helpful; the backslash is almost certainly intended as a Windows path separator, and the only helpful action would be to convert it to "/". I guess that if that is anyone's job, it's the resolver's. This isn't strictly conformant with the XML spec, but I doubt anyone will mind.

Saxon could usefully catch the IllegalArgumentException and turn it into something more meaningful at the XSLT level, treating it like any other XML parsing failure.

The best course of action, of course, would be to use valid URIs, rather than relying on behaviour beyond what's mandated in the standards. I do recognize that a lot of XML software tolerates Windows filenames in contexts where URIs are expected, but it's never entirely clear, for example, how relative filenames should be resolved against absolute URIs.

When I supply the document as a source document to Saxon Transform, I get ``` java.lang.IllegalArgumentException: java.net.URISyntaxException: Illegal character in path at index 2: ..\master\glossary\gls.ent at org.xmlresolver.CatalogResolver.resolveEntity(CatalogResolver.java:292) at org.xmlresolver.Resolver.resolveEntity(Resolver.java:199) at net.sf.saxon.lib.CatalogResourceResolver.resolveEntity(CatalogResourceResolver.java:194) at net.sf.saxon.lib.EntityResolverWrappingResourceResolver.resolveEntity(EntityResolverWrappingResourceResolver.java:46) at org.apache.xerces.util.EntityResolver2Wrapper.resolveEntity(Unknown Source) at org.apache.xerces.impl.XMLEntityManager.resolveEntity(Unknown Source) at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source) ``` So the question is, what would we expect to happen? The XML spec says: > System identifiers (and other XML strings meant to be used as URI references) may contain characters that, according to [[IETF RFC 3986]], must be escaped before a URI can be used to retrieve the referenced resource. The characters to be escaped are the control characters #x0 to #x1F and #x7F (most of which cannot appear in XML), space #x20, the delimiters '<' #x3C, '>' #x3E and '"' #x22, the unwise characters '{' #x7B, '}' #x7D, '|' #x7C, '\' #x5C, '^' #x5E and '`' #x60, as well as all characters above #x7F. I doubt that escaping (that is, percent-encoding) the "unwise" character "\" as suggested here is going to be helpful; the backslash is almost certainly intended as a Windows path separator, and the only helpful action would be to convert it to "/". I guess that if that is anyone's job, it's the resolver's. This isn't strictly conformant with the XML spec, but I doubt anyone will mind. Saxon could usefully catch the `IllegalArgumentException` and turn it into something more meaningful at the XSLT level, treating it like any other XML parsing failure. The best course of action, of course, would be to use valid URIs, rather than relying on behaviour beyond what's mandated in the standards. I do recognize that a lot of XML software tolerates Windows filenames in contexts where URIs are expected, but it's never entirely clear, for example, how relative filenames should be resolved against absolute URIs.
michaelhkay commented 2024-07-17 09:00:47 +02:00 (Migrated from github.com)

Saxon could usefully catch the IllegalArgumentException and turn it into something more meaningful at the XSLT level, treating it like any other XML parsing failure.

Saxon does in fact catch the IllegalArgumentException and wrap it in a SAXException, which seems to me to be the right course of action.

>Saxon could usefully catch the IllegalArgumentException and turn it into something more meaningful at the XSLT level, treating it like any other XML parsing failure. Saxon does in fact catch the `IllegalArgumentException` and wrap it in a `SAXException`, which seems to me to be the right course of action.
ToshihikoMakita commented 2024-07-17 16:19:04 +02:00 (Migrated from github.com)

I do recognize that a lot of XML software tolerates Windows filenames in contexts where URIs are expected

Yes, I absolutely agree. This user has been using Adobe FrameMaker for over 20 years and it uses Windows path as URI without the slightest hesitation. I'm struggling this kind of problem because there are bunch of XML files in their CMS and I cannot fix them because they are user data.
I do expect resolver to have good solution for this kind of complex problem.

> I do recognize that a lot of XML software tolerates Windows filenames in contexts where URIs are expected Yes, I absolutely agree. This user has been using Adobe FrameMaker for over 20 years and it uses Windows path as URI without the slightest hesitation. I'm struggling this kind of problem because there are bunch of XML files in their CMS and I cannot fix them because they are user data. I do expect resolver to have good solution for this kind of complex problem.
ndw commented 2024-07-17 17:17:12 +02:00 (Migrated from github.com)

I think I've managed to reproduce it. It appears to be somewhere deep in Xerces:

  0 = {StackTraceElement@2290} "java.base/java.net.URL.<init>(URL.java:645)"
  1 = {StackTraceElement@2291} "java.base/java.net.URL.<init>(URL.java:541)"
  2 = {StackTraceElement@2292} "java.base/java.net.URL.<init>(URL.java:488)"
  3 = {StackTraceElement@2293} "org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)"
  4 = {StackTraceElement@2294} "org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)"
  5 = {StackTraceElement@2295} "org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)"
  6 = {StackTraceElement@2296} "org.apache.xerces.impl.XMLDTDScannerImpl.startPE(Unknown Source)"
  7 = {StackTraceElement@2297} "org.apache.xerces.impl.XMLDTDScannerImpl.skipSeparator(Unknown Source)"
  8 = {StackTraceElement@2298} "org.apache.xerces.impl.XMLDTDScannerImpl.scanDecls(Unknown Source)"
  9 = {StackTraceElement@2299} "org.apache.xerces.impl.XMLDTDScannerImpl.scanDTDInternalSubset(Unknown Source)"
  10 = {StackTraceElement@2300} "org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source)"
  11 = {StackTraceElement@2301} "org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)"
  12 = {StackTraceElement@2302} "org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)"
  13 = {StackTraceElement@2303} "org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)"
  14 = {StackTraceElement@2304} "org.apache.xerces.parsers.XMLParser.parse(Unknown Source)"
  15 = {StackTraceElement@2305} "org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)"
  16 = {StackTraceElement@2306} "org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)"
  17 = {StackTraceElement@2307} "java.xml/org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:357)"
  18 = {StackTraceElement@2308} "org.xmlresolver.tools.ResolvingXMLFilter.parse(ResolvingXMLFilter.java:119)"

Debugging in Xerces is always a challenge. My best guess is that setupCurrentEntity is trying to make a URL out of the entity system identifier before passing it to the resolver. There's nothing I can do about that.

This doesn't explain why it works with Saxon 12.0 though.

I think I've managed to reproduce it. It appears to be somewhere deep in Xerces: ``` 0 = {StackTraceElement@2290} "java.base/java.net.URL.<init>(URL.java:645)" 1 = {StackTraceElement@2291} "java.base/java.net.URL.<init>(URL.java:541)" 2 = {StackTraceElement@2292} "java.base/java.net.URL.<init>(URL.java:488)" 3 = {StackTraceElement@2293} "org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)" 4 = {StackTraceElement@2294} "org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)" 5 = {StackTraceElement@2295} "org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)" 6 = {StackTraceElement@2296} "org.apache.xerces.impl.XMLDTDScannerImpl.startPE(Unknown Source)" 7 = {StackTraceElement@2297} "org.apache.xerces.impl.XMLDTDScannerImpl.skipSeparator(Unknown Source)" 8 = {StackTraceElement@2298} "org.apache.xerces.impl.XMLDTDScannerImpl.scanDecls(Unknown Source)" 9 = {StackTraceElement@2299} "org.apache.xerces.impl.XMLDTDScannerImpl.scanDTDInternalSubset(Unknown Source)" 10 = {StackTraceElement@2300} "org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source)" 11 = {StackTraceElement@2301} "org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)" 12 = {StackTraceElement@2302} "org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)" 13 = {StackTraceElement@2303} "org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)" 14 = {StackTraceElement@2304} "org.apache.xerces.parsers.XMLParser.parse(Unknown Source)" 15 = {StackTraceElement@2305} "org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)" 16 = {StackTraceElement@2306} "org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)" 17 = {StackTraceElement@2307} "java.xml/org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:357)" 18 = {StackTraceElement@2308} "org.xmlresolver.tools.ResolvingXMLFilter.parse(ResolvingXMLFilter.java:119)" ``` Debugging in Xerces is always a challenge. My best guess is that `setupCurrentEntity` is trying to make a URL out of the entity system identifier *before* passing it to the resolver. There's nothing I can do about that. This doesn't explain why it works with Saxon 12.0 though.
ndw commented 2024-07-17 17:34:14 +02:00 (Migrated from github.com)

I get exactly the same failure with Saxon 12.0 which suggests there's something else going on in your environment:

$ java -jar saxon-he-12.0.jar -s:iss0184/src/SBBVT0T-Deployment-Flat-mod.xml -xsl:/Volumes/Documents/xsl/identity.xsl
config: Logging: *:debug
config: Prefer public: true
config: Prefer property file: false
config: Allow catalog PI: true
config: Parse RDDL: true
config: URI for system: true
config: Merge http/https: true
config: Mask jar URIs: true
config: Cache under home: false
config: Cache directory: null
config: Cache enabled: false
config: Catalog loader: org.xmlresolver.loaders.XmlLoader
config: Classpath catalogs: true
config: Archived catalogs: true
config: Throw URI exceptions: false
config: Class loader: jdk.internal.loader.ClassLoaders$AppClassLoader@1cf4f579
config: Logger class: org.xmlresolver.logging.DefaultLogger
config: Access external entity: all
config: Access external document: all
config: SAXParserFactory class: null
config: XMLReader supplier: org.xmlresolver.ResolverFeature$$Lambda/0x0000007001019860@64616ca2
config: Fix Windows system identifiers: true
config: Default logger log level: debug
config: Searching for catalogs on classpath:
config: Catalog: jar:file:/private/tmp/x/lib/xmlresolver-4.6.0-data.jar!/org/xmlresolver/catalog.xml
config: Throw URI exceptions: true
request: resolveEntity: ..\master\glossary\gls.ent (baseURI: file:/private/tmp/x/iss0184/src/SBBVT0T-Deployment-Flat-mod.xml, publicId: null)
error: URI exception: ..\master\glossary\gls.ent (base: file:/private/tmp/x/iss0184/src/SBBVT0T-Deployment-Flat-mod.xml)
java.lang.IllegalArgumentException: java.net.URISyntaxException: Illegal character in path at index 2: ..\master\glossary\gls.ent
        at org.xmlresolver.CatalogResolver.resolveEntity(CatalogResolver.java:285)
        at org.xmlresolver.Resolver.resolveEntity(Resolver.java:170)
        at net.sf.saxon.lib.CatalogResourceResolver.resolveEntity(CatalogResourceResolver.java:194)
        at net.sf.saxon.lib.EntityResolverWrappingResourceResolver.resolveEntity(EntityResolverWrappingResourceResolver.java:45)
        at java.xml/com.sun.org.apache.xerces.internal.util.EntityResolver2Wrapper.resolveEntity(EntityResolver2Wrapper.java:178)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLEntityManager.resolveEntityAsPerStax(XMLEntityManager.java:1027)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:1308)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.startPE(XMLDTDScannerImpl.java:732)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.skipSeparator(XMLDTDScannerImpl.java:2101)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanDecls(XMLDTDScannerImpl.java:2064)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanDTDInternalSubset(XMLDTDScannerImpl.java:356)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(XMLDocumentScannerImpl.java:1091)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(XMLDocumentScannerImpl.java:1040)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:917)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:114)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:542)
        at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:889)
        at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:825)
        at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
        at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1224)
        at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:637)
        at net.sf.saxon.resource.ActiveSAXSource.deliver(ActiveSAXSource.java:190)
        at net.sf.saxon.resource.ActiveStreamSource.deliver(ActiveStreamSource.java:65)
        at net.sf.saxon.event.Sender.send(Sender.java:104)
        at net.sf.saxon.Configuration.buildDocumentTree(Configuration.java:4182)
        at net.sf.saxon.s9api.DocumentBuilder.build(DocumentBuilder.java:334)
        at net.sf.saxon.Transform.processFile(Transform.java:1350)
        at net.sf.saxon.Transform.doTransform(Transform.java:879)
        at net.sf.saxon.Transform.main(Transform.java:83)
Caused by: java.net.URISyntaxException: Illegal character in path at index 2: ..\master\glossary\gls.ent
        at java.base/java.net.URI$Parser.fail(URI.java:2995)
        at java.base/java.net.URI$Parser.checkChars(URI.java:3166)
        at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3248)
        at java.base/java.net.URI$Parser.parse(URI.java:3207)
        at java.base/java.net.URI.<init>(URI.java:645)
        at org.xmlresolver.CatalogResolver.resolveEntity(CatalogResolver.java:261)
        ... 29 more
Fatal error during transformation: java.lang.IllegalArgumentException: java.net.URISyntaxException: Illegal character in path at index 2: ..\master\glossary\gls.ent
I get exactly the same failure with Saxon 12.0 which suggests there's something else going on in your environment: ``` $ java -jar saxon-he-12.0.jar -s:iss0184/src/SBBVT0T-Deployment-Flat-mod.xml -xsl:/Volumes/Documents/xsl/identity.xsl config: Logging: *:debug config: Prefer public: true config: Prefer property file: false config: Allow catalog PI: true config: Parse RDDL: true config: URI for system: true config: Merge http/https: true config: Mask jar URIs: true config: Cache under home: false config: Cache directory: null config: Cache enabled: false config: Catalog loader: org.xmlresolver.loaders.XmlLoader config: Classpath catalogs: true config: Archived catalogs: true config: Throw URI exceptions: false config: Class loader: jdk.internal.loader.ClassLoaders$AppClassLoader@1cf4f579 config: Logger class: org.xmlresolver.logging.DefaultLogger config: Access external entity: all config: Access external document: all config: SAXParserFactory class: null config: XMLReader supplier: org.xmlresolver.ResolverFeature$$Lambda/0x0000007001019860@64616ca2 config: Fix Windows system identifiers: true config: Default logger log level: debug config: Searching for catalogs on classpath: config: Catalog: jar:file:/private/tmp/x/lib/xmlresolver-4.6.0-data.jar!/org/xmlresolver/catalog.xml config: Throw URI exceptions: true request: resolveEntity: ..\master\glossary\gls.ent (baseURI: file:/private/tmp/x/iss0184/src/SBBVT0T-Deployment-Flat-mod.xml, publicId: null) error: URI exception: ..\master\glossary\gls.ent (base: file:/private/tmp/x/iss0184/src/SBBVT0T-Deployment-Flat-mod.xml) java.lang.IllegalArgumentException: java.net.URISyntaxException: Illegal character in path at index 2: ..\master\glossary\gls.ent at org.xmlresolver.CatalogResolver.resolveEntity(CatalogResolver.java:285) at org.xmlresolver.Resolver.resolveEntity(Resolver.java:170) at net.sf.saxon.lib.CatalogResourceResolver.resolveEntity(CatalogResourceResolver.java:194) at net.sf.saxon.lib.EntityResolverWrappingResourceResolver.resolveEntity(EntityResolverWrappingResourceResolver.java:45) at java.xml/com.sun.org.apache.xerces.internal.util.EntityResolver2Wrapper.resolveEntity(EntityResolver2Wrapper.java:178) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLEntityManager.resolveEntityAsPerStax(XMLEntityManager.java:1027) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:1308) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.startPE(XMLDTDScannerImpl.java:732) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.skipSeparator(XMLDTDScannerImpl.java:2101) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanDecls(XMLDTDScannerImpl.java:2064) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanDTDInternalSubset(XMLDTDScannerImpl.java:356) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(XMLDocumentScannerImpl.java:1091) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(XMLDocumentScannerImpl.java:1040) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:917) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:114) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:542) at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:889) at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:825) at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1224) at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:637) at net.sf.saxon.resource.ActiveSAXSource.deliver(ActiveSAXSource.java:190) at net.sf.saxon.resource.ActiveStreamSource.deliver(ActiveStreamSource.java:65) at net.sf.saxon.event.Sender.send(Sender.java:104) at net.sf.saxon.Configuration.buildDocumentTree(Configuration.java:4182) at net.sf.saxon.s9api.DocumentBuilder.build(DocumentBuilder.java:334) at net.sf.saxon.Transform.processFile(Transform.java:1350) at net.sf.saxon.Transform.doTransform(Transform.java:879) at net.sf.saxon.Transform.main(Transform.java:83) Caused by: java.net.URISyntaxException: Illegal character in path at index 2: ..\master\glossary\gls.ent at java.base/java.net.URI$Parser.fail(URI.java:2995) at java.base/java.net.URI$Parser.checkChars(URI.java:3166) at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3248) at java.base/java.net.URI$Parser.parse(URI.java:3207) at java.base/java.net.URI.<init>(URI.java:645) at org.xmlresolver.CatalogResolver.resolveEntity(CatalogResolver.java:261) ... 29 more Fatal error during transformation: java.lang.IllegalArgumentException: java.net.URISyntaxException: Illegal character in path at index 2: ..\master\glossary\gls.ent ```
ToshihikoMakita commented 2024-07-17 21:05:38 +02:00 (Migrated from github.com)

Forgive me submitting basic question.

$ java -jar saxon-he-12.0.jar -s:iss0184/src/SBBVT0T-Deployment-Flat-mod.xml -xsl:/Volumes/Documents/xsl/identity.xsl

In this command-line, how Saxon find xmlresolver jar file?

In my case, I invoked Saxon using following Power Shell script code. (Attached as build-db2db.zip for your reference)

[Excerpt from attached build-db2db.ps1]

# XMLResolver 4.4.0 .jar file path
# Reference: https://saxonica.plan.io/issues/5580

$xml_resolver_path = $ps_dir + '/xmlresolver/xmlresolver-4.6.0/lib/xmlresolver-4.6.0.jar'
# $xml_resolver_path = $ps_dir + '/xmlresolver/xmlresolver-4.4.0/lib/xmlresolver-4.4.0.jar'
# $xml_resolver_path = $ps_dir + '/xmlresolver/xmlresolver-5.2.3/lib/xmlresolver-5.2.3.jar'


# --------------------------------------------------------- #
# Expand entity in XML file                                 #
# --------------------------------------------------------- #

# Java command option & Saxon option/parameter
$java_option = " -Xmx1024m -cp $xml_resolver_path;$saxon_path; -Dxml.catalog.fixWindowsSystemIdentifiers=true"
$java_class = ' net.sf.saxon.Transform'
$java_argument = ' -xsl:' + $xsl_path + ' -s:' + $input_xml_path + ' -o:' + $output_xml_path  + ' -ea:on' + ' PRM_INPUT_FILE_URL=' + $input_xml_url
$java_cmd_param = $java_option + $java_class + $java_argument

Write-Host "Start expanding entities in XML file" -ForegroundColor Cyan -BackgroundColor Black;
Write-Host "Input file: $input_xml_path" -ForegroundColor Cyan -BackgroundColor Black;
Write-Host "Output file: $output_xml_path" -ForegroundColor Cyan -BackgroundColor Black;
if ($v -eq $TRUE){
    Write-Host "Input file url: $input_xml_url" -ForegroundColor Cyan -BackgroundColor Black;
    Write-Host "Java executable: $java_exec" -ForegroundColor Cyan -BackgroundColor Black;
    Write-Host "Java command parameter: $java_cmd_param" -ForegroundColor Cyan -BackgroundColor Black;
}

$start_date_time = Get-Date

# $java_cmd = $java_exec + $java_cmd_option
# Invoke-Expression -Command $java_cmd

$ret = [Proc.Tools.exec]::runCommand($java_exec, $java_cmd_param);

Write-Host 'XSLT processing return code:' $ret  -ForegroundColor Magenta -BackgroundColor Black
if ($ret -ne 0) {exit}

$end_date_time = Get-Date
$end_date_time_formatted = Get-FormatDateTime -dateTime $end_date_time -format 'yyyy/MM/dd HH:mm:ss'
$time_span = Get-TimeSpan -startTime $start_date_time -endTime $end_date_time
Write-Host 'Processing takes' $time_span.Minutes 'minutes ' $time_span.Seconds 'seconds.' -ForegroundColor Cyan -BackgroundColor Black
Write-Host "Job ended at $end_date_time_formatted" -ForegroundColor Cyan -BackgroundColor Black

build-db2db.zip

Forgive me submitting basic question. > $ java -jar saxon-he-12.0.jar -s:iss0184/src/SBBVT0T-Deployment-Flat-mod.xml -xsl:/Volumes/Documents/xsl/identity.xsl In this command-line, how Saxon find xmlresolver jar file? In my case, I invoked Saxon using following Power Shell script code. (Attached as build-db2db.zip for your reference) [Excerpt from attached build-db2db.ps1] ``` # XMLResolver 4.4.0 .jar file path # Reference: https://saxonica.plan.io/issues/5580 $xml_resolver_path = $ps_dir + '/xmlresolver/xmlresolver-4.6.0/lib/xmlresolver-4.6.0.jar' # $xml_resolver_path = $ps_dir + '/xmlresolver/xmlresolver-4.4.0/lib/xmlresolver-4.4.0.jar' # $xml_resolver_path = $ps_dir + '/xmlresolver/xmlresolver-5.2.3/lib/xmlresolver-5.2.3.jar' # --------------------------------------------------------- # # Expand entity in XML file # # --------------------------------------------------------- # # Java command option & Saxon option/parameter $java_option = " -Xmx1024m -cp $xml_resolver_path;$saxon_path; -Dxml.catalog.fixWindowsSystemIdentifiers=true" $java_class = ' net.sf.saxon.Transform' $java_argument = ' -xsl:' + $xsl_path + ' -s:' + $input_xml_path + ' -o:' + $output_xml_path + ' -ea:on' + ' PRM_INPUT_FILE_URL=' + $input_xml_url $java_cmd_param = $java_option + $java_class + $java_argument Write-Host "Start expanding entities in XML file" -ForegroundColor Cyan -BackgroundColor Black; Write-Host "Input file: $input_xml_path" -ForegroundColor Cyan -BackgroundColor Black; Write-Host "Output file: $output_xml_path" -ForegroundColor Cyan -BackgroundColor Black; if ($v -eq $TRUE){ Write-Host "Input file url: $input_xml_url" -ForegroundColor Cyan -BackgroundColor Black; Write-Host "Java executable: $java_exec" -ForegroundColor Cyan -BackgroundColor Black; Write-Host "Java command parameter: $java_cmd_param" -ForegroundColor Cyan -BackgroundColor Black; } $start_date_time = Get-Date # $java_cmd = $java_exec + $java_cmd_option # Invoke-Expression -Command $java_cmd $ret = [Proc.Tools.exec]::runCommand($java_exec, $java_cmd_param); Write-Host 'XSLT processing return code:' $ret -ForegroundColor Magenta -BackgroundColor Black if ($ret -ne 0) {exit} $end_date_time = Get-Date $end_date_time_formatted = Get-FormatDateTime -dateTime $end_date_time -format 'yyyy/MM/dd HH:mm:ss' $time_span = Get-TimeSpan -startTime $start_date_time -endTime $end_date_time Write-Host 'Processing takes' $time_span.Minutes 'minutes ' $time_span.Seconds 'seconds.' -ForegroundColor Cyan -BackgroundColor Black Write-Host "Job ended at $end_date_time_formatted" -ForegroundColor Cyan -BackgroundColor Black ``` [build-db2db.zip](https://github.com/user-attachments/files/16273579/build-db2db.zip)
ToshihikoMakita commented 2024-07-17 21:16:14 +02:00 (Migrated from github.com)

$ java -jar saxon-he-12.0.jar -s:iss0184/src/SBBVT0T-Deployment-Flat-mod.xml -xsl:/Volumes/Documents/xsl/identity.xsl

I'm using Saxon-PE because XSL stylesheet uses reflexive extension functions.

> $ java -jar saxon-he-12.0.jar -s:iss0184/src/SBBVT0T-Deployment-Flat-mod.xml -xsl:/Volumes/Documents/xsl/identity.xsl I'm using Saxon-PE because XSL stylesheet uses reflexive extension functions.
ndw commented 2024-07-18 11:17:37 +02:00 (Migrated from github.com)

I doubt that HE/PE/EE is going to make any difference here. In my command line example, Saxon finds the jar file because if you use java -jar to run it, it adds the files in the lib/ directory of the distribution to the classpath automatically. I'm no Powershell expert and that's a quite complex looking Powershell script, but I shall see if I can reproduce it.

Finding out how it works for you with 12.0 is the next key step in working out what is different in 12.5.

I doubt that HE/PE/EE is going to make any difference here. In my command line example, Saxon finds the jar file because if you use `java -jar` to run it, it adds the files in the `lib/` directory of the distribution to the classpath automatically. I'm no Powershell expert and that's a quite complex looking Powershell script, but I shall see if I can reproduce it. Finding out how it works for you with 12.0 is the next key step in working out what is different in 12.5.
ndw commented 2024-07-18 11:45:51 +02:00 (Migrated from github.com)

Here's my attempt to reproduce the Powershell script:

XML_RESOLVER_PATH=`pwd`/xmlresolver-4.6.0.jar
SAXON_PATH=`pwd`/saxon120/saxon-pe-12.0.jar

JAVA_OPTION=" -Xmx1024m -cp $XML_RESOLVER_PATH:$SAXON_PATH -Dxml.catalog.fixWindowsSystemIdentifiers=true"
JAVA_CLASS=" net.sf.saxon.Transform"
JAVA_ARG=" -xsl:identity.xsl -s:src/SBBVT0T-Deployment-Flat-mod.xml -o:out.xml -ea:on"

java $JAVA_OPTION $JAVA_CLASS $JAVA_ARG

That runs

java -Xmx1024m -cp /tmp/x/xmlresolver-4.6.0.jar:/tmp/x/saxon120/saxon-pe-12.0.jar -Dxml.catalog.fixWindowsSystemIdentifiers=true net.sf.saxon.Transform -xsl:identity.xsl -s:src/SBBVT0T-Deployment-Flat-mod.xml -o:out.xml -ea:on

and fails in just the same way that it did before. My source document src/SBBVT0T-Deployment-Flat-mod.xml is

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE book SYSTEM "ymcsm2-4.dtd"[
<!--
<!ENTITY G110688 SYSTEM "..\master\illustration\G110688.eps" NDATA epsi>
<!ENTITY G110689 SYSTEM "..\master\illustration\G110689.eps" NDATA epsi>
-->
<!-- Begin Glossary entities -->
<!ENTITY % gls.entities SYSTEM "..\master\glossary\gls.ent">
%gls.entities;
<!-- End Glossary entities -->
]>
<book>&test;</book>

my DTD, src/ymcsm2-4.dtd is

<!ELEMENT book (#PCDATA)*>

and my entity file, master/glossary/gls.ent is

<!ENTITY test "This is a test. This is only a test.">

Can you reproduce a working example using those files and with a simpler driver script?

Here's my attempt to reproduce the Powershell script: ``` XML_RESOLVER_PATH=`pwd`/xmlresolver-4.6.0.jar SAXON_PATH=`pwd`/saxon120/saxon-pe-12.0.jar JAVA_OPTION=" -Xmx1024m -cp $XML_RESOLVER_PATH:$SAXON_PATH -Dxml.catalog.fixWindowsSystemIdentifiers=true" JAVA_CLASS=" net.sf.saxon.Transform" JAVA_ARG=" -xsl:identity.xsl -s:src/SBBVT0T-Deployment-Flat-mod.xml -o:out.xml -ea:on" java $JAVA_OPTION $JAVA_CLASS $JAVA_ARG ``` That runs ``` java -Xmx1024m -cp /tmp/x/xmlresolver-4.6.0.jar:/tmp/x/saxon120/saxon-pe-12.0.jar -Dxml.catalog.fixWindowsSystemIdentifiers=true net.sf.saxon.Transform -xsl:identity.xsl -s:src/SBBVT0T-Deployment-Flat-mod.xml -o:out.xml -ea:on ``` and fails in just the same way that it did before. My source document `src/SBBVT0T-Deployment-Flat-mod.xml` is ``` <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE book SYSTEM "ymcsm2-4.dtd"[ <!-- <!ENTITY G110688 SYSTEM "..\master\illustration\G110688.eps" NDATA epsi> <!ENTITY G110689 SYSTEM "..\master\illustration\G110689.eps" NDATA epsi> --> <!-- Begin Glossary entities --> <!ENTITY % gls.entities SYSTEM "..\master\glossary\gls.ent"> %gls.entities; <!-- End Glossary entities --> ]> <book>&test;</book> ``` my DTD, `src/ymcsm2-4.dtd` is ``` <!ELEMENT book (#PCDATA)*> ``` and my entity file, `master/glossary/gls.ent` is ``` <!ENTITY test "This is a test. This is only a test."> ``` Can you reproduce a working example using those files and with a simpler driver script?
ToshihikoMakita commented 2024-07-18 12:31:16 +02:00 (Migrated from github.com)

Thank you for your reply.
I am testing more simpler one without PowerShell.

Thank you for your reply. I am testing more simpler one without PowerShell.
ToshihikoMakita commented 2024-07-18 15:24:53 +02:00 (Migrated from github.com)

In my operating environment, at least saxon-pe-12.0.jar plus xmlresolver-4.6.0.jar seems to be working. Other combination will report java.lang.IllegalArgumentException.

I attached the test data folder: saxon-test-3-2024-07-18.zip

In this test data, the DTD file is empty. The original DTD file refers lots of entities and it is meaningless to attach them all.
Here are my screen shots.

2024-07-18-9

2024-07-18-10

All of the command-lines are stored in invoke.txt.

saxon-test-3-2024-07-18.zip

Is this information useful for you??

In my operating environment, at least saxon-pe-12.0.jar plus xmlresolver-4.6.0.jar seems to be working. Other combination will report java.lang.IllegalArgumentException. I attached the test data folder: saxon-test-3-2024-07-18.zip In this test data, the DTD file is empty. The original DTD file refers lots of entities and it is meaningless to attach them all. Here are my screen shots. ![2024-07-18-9](https://github.com/user-attachments/assets/ce71ffa4-dc46-4fc3-b1c9-10b95d0f3f31) ![2024-07-18-10](https://github.com/user-attachments/assets/32e0e2ba-d5be-4627-8df2-19b7ef39558f) All of the command-lines are stored in invoke.txt. [saxon-test-3-2024-07-18.zip](https://github.com/user-attachments/files/16283836/saxon-test-3-2024-07-18.zip) Is this information useful for you??
ndw commented 2024-07-18 18:21:10 +02:00 (Migrated from github.com)

Yes. Very. I have construct a passing case on a Windows machine. That's difficult and tedious for debugging, but it's a place to start. Thank you.

Yes. Very. I have construct a passing case on a Windows machine. That's difficult and tedious for debugging, but it's a place to start. Thank you.
ndw commented 2024-07-22 13:04:25 +02:00 (Migrated from github.com)

Right. I believe I've found and fixed the bug in (what will be 5.2.4). Next, I want to see if I can fix it in the 6.x branch.

Right. I believe I've found and fixed the bug in (what will be 5.2.4). Next, I want to see if I can fix it in the 6.x branch.
ndw commented 2024-07-22 18:05:09 +02:00 (Migrated from github.com)

I've published a 5.2.4 release and pushed the 5.2.4 release to Maven. There's a little weirdness in the unit tests, but I think the problem is resolved. Please do let me know if I'm mistaken!

I've published a 5.2.4 release and pushed the 5.2.4 release to Maven. There's a *little* weirdness in the unit tests, but I think the problem is resolved. Please do let me know if I'm mistaken!
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
XmlResolver/xmlresolver#184
No description provided.