
Hello, I'm trying to add a simple catalog. I've read lots of doc and it seems that this should be straightforward, so I'm staring to feel like a doofus. (And tell me it's not a Mac problem...) I'm trying to validate a log4j.xml file which has the following first few lines: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false"> Figured I would map the system identifier "log4j.dtd" to the actual file on my local disk, and I created a catalog.xml file with the following: <?xml version="1.0"?> <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"> <system systemId="log4j.dtd" uri="file:///Users/john/Documents/oxygen/log4j.dtd"/> </catalog> I added this file to the list of catalogs and restarted OxygenXML. It always claims that the log4j.dtd file can't be found in the source directory containing log4j.xml. This leads me to believe that it never looks for the one I've defined in the catalog. I've tried all kinds of different URIs for the actual DTD location and nothing seems to work. Can someone provide some insight as to what I'm doing wrong? Thanks, . John -- p..s. I found that the catalog file itself wouldn't validate either when I put in it's doctype, which seems very strange: <?xml version="1.0"?> <!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd"> <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"> <system systemId="log4j.dtd" uri="file:///Users/john/Documents/oxygen/log4j.dtd"/> </catalog> gives me "Cannot find the declaration of element 'catalog'" when I try to validate it. Seems like this should work since I can hit the system ID fine with my browser.

I figured out the section in the "p.s.". I had the "Use only XML Schema for validation" checked. Turning this off didn't fix the catalog resolution, however. . John

Hello, The XML parser resolves only full URIs using the catalog so if you specify the system ID with a relative path first it will be expanded to its full path and then searched in the catalog. If the XML document is located in the directory C:\work then you must specify in the catalog: <system systemId="file:///C:/work/log4j.dtd" uri="file:///Users/john/Documents/oxygen/log4j.dtd"/> You can make the document portable if you use a system ID like logging.apache.org/site/log4j.dtd in the document and <system systemId="logging.apache.org/site/log4j.dtd" uri="file:///Users/john/Documents/oxygen/log4j.dtd"/> in the catalog where the uri attribute is modified by each user to correspond to the path on the local machine. Best regards, Sorin John Kelly wrote:
Hello,
I'm trying to add a simple catalog. I've read lots of doc and it seems that this should be straightforward, so I'm staring to feel like a doofus. (And tell me it's not a Mac problem...)
I'm trying to validate a log4j.xml file which has the following first few lines:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
Figured I would map the system identifier "log4j.dtd" to the actual file on my local disk, and I created a catalog.xml file with the following:
<?xml version="1.0"?> <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<system systemId="log4j.dtd" uri="file:///Users/john/Documents/oxygen/log4j.dtd"/>
</catalog>
I added this file to the list of catalogs and restarted OxygenXML. It always claims that the log4j.dtd file can't be found in the source directory containing log4j.xml. This leads me to believe that it never looks for the one I've defined in the catalog. I've tried all kinds of different URIs for the actual DTD location and nothing seems to work.
Can someone provide some insight as to what I'm doing wrong?
Thanks, . John -- p..s. I found that the catalog file itself wouldn't validate either when I put in it's doctype, which seems very strange:
<?xml version="1.0"?> <!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
"http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd"> <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"> <system systemId="log4j.dtd" uri="file:///Users/john/Documents/oxygen/log4j.dtd"/> </catalog>
gives me "Cannot find the declaration of element 'catalog'" when I try to validate it. Seems like this should work since I can hit the system ID fine with my browser.
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user

Sorry for the portable document you have to use something like http://logging.apache.org/site/log4j.dtd and in the catalog <system systemId="http://logging.apache.org/site/log4j.dtd" uri="file:///Users/john/Documents/oxygen/log4j.dtd"/> Regards, Sorin Sorin Ristache wrote:
Hello,
The XML parser resolves only full URIs using the catalog so if you specify the system ID with a relative path first it will be expanded to its full path and then searched in the catalog. If the XML document is located in the directory C:\work then you must specify in the catalog:
<system systemId="file:///C:/work/log4j.dtd" uri="file:///Users/john/Documents/oxygen/log4j.dtd"/>
You can make the document portable if you use a system ID like logging.apache.org/site/log4j.dtd in the document and
<system systemId="logging.apache.org/site/log4j.dtd" uri="file:///Users/john/Documents/oxygen/log4j.dtd"/>
in the catalog where the uri attribute is modified by each user to correspond to the path on the local machine.
Best regards, Sorin
John Kelly wrote:
Hello,
I'm trying to add a simple catalog. I've read lots of doc and it seems that this should be straightforward, so I'm staring to feel like a doofus. (And tell me it's not a Mac problem...)
I'm trying to validate a log4j.xml file which has the following first few lines:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
Figured I would map the system identifier "log4j.dtd" to the actual file on my local disk, and I created a catalog.xml file with the following:
<?xml version="1.0"?> <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<system systemId="log4j.dtd" uri="file:///Users/john/Documents/oxygen/log4j.dtd"/>
</catalog>
I added this file to the list of catalogs and restarted OxygenXML. It always claims that the log4j.dtd file can't be found in the source directory containing log4j.xml. This leads me to believe that it never looks for the one I've defined in the catalog. I've tried all kinds of different URIs for the actual DTD location and nothing seems to work.
Can someone provide some insight as to what I'm doing wrong?
Thanks, . John -- p..s. I found that the catalog file itself wouldn't validate either when I put in it's doctype, which seems very strange:
<?xml version="1.0"?> <!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
"http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd"> <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"> <system systemId="log4j.dtd" uri="file:///Users/john/Documents/oxygen/log4j.dtd"/> </catalog>
gives me "Cannot find the declaration of element 'catalog'" when I try to validate it. Seems like this should work since I can hit the system ID fine with my browser.
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
participants (2)
-
John Kelly
-
Sorin Ristache