XPath over a collection of XHTML files - 503 error

Having trouble installing Oxygen? Got a bug to report? Post it all here.
sanderson
Posts: 51
Joined: Fri Jan 27, 2006 12:51 am

XPath over a collection of XHTML files - 503 error

Post by sanderson »

Using XPath 2.0 in oxygen to find all instances of a particular XPath in a collection of XHTML files

Code: Select all

collection('?recurse=yes;select=*.htm')//dd//ul
I get the following error:
org.apache.commons.httpclient.HttpException: 503 Service Unavailable for:
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
I think this is due to the W3 org's limits on how often you can ping a DTD file from a particular IP address.

Is there an option to use local validation, or, cache the DTD files for validation?

BTW, just want to say again, oxygen is one of the best tools I have ever used. I'm not kissing up in hopes of help (I know y'all will help anyway), but it's so rare that I find a tool that I like to use, rather than have to use, that I want to make sure you know.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: XPath over a collection of XHTML files - 503 error

Post by sorin_ristache »

Hello,

You should map the URL to a local version of the xhtml1-transitional.dtd file with an XML catalog that contains:

Code: Select all

<system systemId="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" uri="your/path/xhtml1-transitional.dtd"/>
where your/path/xhtml1-transitional.dtd is relative to the XML catalog file or an absolute path on your local computer. You have to add the XML catalog to the list available from menu Options -> Preferences -> XML -> XML Catalog.


Regards,
Sorin
sanderson
Posts: 51
Joined: Fri Jan 27, 2006 12:51 am

Re: XPath over a collection of XHTML files - 503 error

Post by sanderson »

Of course that's the right solution, thanks for turning me towards it. Oxygen comes bundled with a catalog to do just that (frameworks\xhtml\dtd\xhtmlcatalog.xml) so I added it to my XML catalog in oxygen's preferences.

I was surprised to see that there was no reference to any of the HTML dtds in the default oxygen catalog.

Steve
sanderson
Posts: 51
Joined: Fri Jan 27, 2006 12:51 am

Re: XPath over a collection of XHTML files - 503 error

Post by sanderson »

Sadly, this didn't work. I ran into the same issue this afternoon. I can validate, but I can't run an xpath query.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: XPath over a collection of XHTML files - 503 error

Post by sorin_ristache »

sanderson wrote:Oxygen comes bundled with a catalog to do just that (frameworks\xhtml\dtd\xhtmlcatalog.xml) so I added it to my XML catalog in oxygen's preferences.

I was surprised to see that there was no reference to any of the HTML dtds in the default oxygen catalog.
There is a reference to the catalog that you mentioned (frameworks\xhtml\dtd\xhtmlcatalog.xml) that maps the URL of the DTD for XHTML Transitional that you used in your XHTML documents (http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd) to a local copy of the DTD. The local copy of the DTD comes with oXygen. You can find the catalog in the XHTML document type that also comes with oXygen. Go to menu Options -> Preferences -> Document Type Association, edit the XHTML document type and in the Catalogs tab of the edit dialog you can find the catalog.


Regards,
Sorin
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: XPath over a collection of XHTML files - 503 error

Post by sorin_ristache »

sanderson wrote:Sadly, this didn't work. I ran into the same issue this afternoon. I can validate, but I can't run an xpath query.
The same problem was solved on the oXygen-user mailing list. The solution is also mentioned in the oXygen User Manual. I will repeat the solution here for other users that may have the same problem. In case of the XPath 2.0 collection() function executed by Saxon 9 (in an XSLT 2.0 transformation or in an XPath 2.0 query executed in the XPath toolbar of oXygen) the references used inside the files of the collection are resolved with an XML catalog only if a catalog enabled parser is provided to Saxon's collection resolver. You can find in the User Manual how you should specify such a parser in oXygen.


Regards,
Sorin
sanderson
Posts: 51
Joined: Fri Jan 27, 2006 12:51 am

Re: XPath over a collection of XHTML files - 503 error

Post by sanderson »

Thanks, works like a charm.

Why is there an oxygen mailing list and these forums? Shouldn't it be one or the other?
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: XPath over a collection of XHTML files - 503 error

Post by george »

They are different channels with different access and usage. On a forum you post a message and subscribe to follow only specific topics while on a mailing list you receive all the messages sent by other users. Plus each user has his/her own preference...

Best Regards,
George
George Cristian Bina
Post Reply