2 Jun 16:28
Re: [Serna] Compiling non-standard attributes with DITA open toolkit
From: Eric Sirois <esirois@...>
Subject: Re: [Serna] Compiling non-standard attributes with DITA open toolkit
Newsgroups: gmane.editors.serna.user
Date: 2008-06-02 14:28:16 GMT
Subject: Re: [Serna] Compiling non-standard attributes with DITA open toolkit
Newsgroups: gmane.editors.serna.user
Date: 2008-06-02 14:28:16 GMT
Hello Grzegorz,
Yes, XSD does provide that capability to enforce content via datatypes. For instance, making sure that dates follow ISO 8601 standard. I just uploaded some fixes to OASIS a couple of weeks ago. Both are equivalent, but if there is a discrepancy between the two, the DTDs will be normative.
If you are planning to use the out-of-the box topic types, either one will be fine. If you have a requirement for entities, then you have to use the DTDs (remove XSD). If you are planning on creating new specializations then DTDs are easier. The XSD 1.0 spec does not make specialization an easy process. I hoping that we will be able to simplify things when XSD 1.1 comes out.
You will need to change multiple files, because each topic will need to add the xmlns and xsi attributes. To get a sense of what file would need to be changed for the DTDs look for %arch-atts; in the *.mod files.
If you don't remove the doctype in you will get both. I think that the best suggestion, at the moment, is the one that Paul provided. - adjust the templates to remove the XML Schema attributes.
Hope that helps.
Kind rgards,
Eric
Eric A. Sirois
Staff Software Developer
DB2 Universal Database - Information Development
DITA Migration and Tools Development
IBM Canada Ltd. - Toronto Software Lab
Email: esirois-G1DYhSM1WHTQT0dZR+AlfA@public.gmane.org
Phone:(905) 413-2841
Blue Pages (Internal)
"Transparency and accessibility requirements dictate that public information and government
transactions avoid depending on technologies that imply or impose a specific product or
platform on businesses or citizens" - EU on XML-based office document formats.
| Grzegorz Junka <xgjx-wo4oW1Pw1HF3vZ0LZ0W7Rg@public.gmane.org>
05/31/2008 08:46 AM |
|
Hi Eric,
Thanks for your response. I did some reading and it looks like it is better if documents get XSD validation instead of DTD validation, but it probably depends on the type of documents and the purpose of validation? I wouldn't know which option to choose as I don't know what are the differences in choosing these options.
Regarding c), if I don't remove DOCTYPE won't I get both XSD and DTD validation?
Also, to include bot xmlxs:xsi and xsi:noNamespaceSchemaLocation in DTDs I should be able to change only one file, as all the other topic types derive from the main topic? Is that right, and which file I would need to change? I tried to find out but there are a few DTD files related to the main topic definition.
Many thanks for your help
Regards
Grzegorz Junka
Eric Sirois wrote:
Hello Grzegorz,
It's not a bug per se. That final decision rests with the folks at Syntext. Serna has the capability to support entities (which XML Schema does not have). In order to do get that capability, Serna uses in-line DOCTYPE.
That said, to process those documents in the Toolkit one needs to do one of the following:
a) remove the DOCTYPE from the XML docs; you get XSD validation
b) remove xmlxs:xsi namespace and xsi:noNamespaceSchemaLocation attribute from the XML docs; you get DTD validation
c) modify the DTDs in the Toolkit to include xmlxs:xsi namespace and xsi:noNamespaceSchemaLocation attribute; you get DTD validation
Changing the XML parser parameters will not do anything useful since it is dependent on what appears in the XML docs. The easiest one to do ay this point would be to modify the DTDs in the Toolkit. That would allow you to process the documents without having to modify each one them.
Kind regards,
Eric
Eric A. Sirois
Staff Software Developer
DB2 Universal Database - Information Development
DITA Migration and Tools Development
IBM Canada Ltd. - Toronto Software Lab
Email: esirois-G1DYhSM1WHTQT0dZR+AlfA@public.gmane.org
Phone:(905) 413-2841
Blue Pages (Internal)
"Transparency and accessibility requirements dictate that public information and government
transactions avoid depending on technologies that imply or impose a specific product or
platform on businesses or citizens" - EU on XML-based office document formats.
| Grzegorz Junka <xgjx-wo4oW1Pw1HF3vZ0LZ0W7Rg@public.gmane.org>
05/26/2008 02:52 PM |
|
Hi Eric,
I may understand what causes the parser to validate the document using the Map DTD but what I don't understand is why this the default template of a document created with Serna Syntext. If I need to manually amend each created document then this is clearly a bug. Do you agree?
BTW Could you please advise what would be the best solution here? Changing the beginning of the file to comply with both XML and DTD definitions or changing parameters of the XML parser?
Thanks for your help & Regards
Grzegorz Junka
Eric Sirois wrote:
Hi Grzegorz,
Ahh. That's not an issue with the XML Schema. You are getting that error because the xml document contains a DOCTYPE.
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd" []>
<map xsi:noNamespaceSchemaLocation="urn:oasis:names:tc:dita:xsd:concept.xsd:1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
The XML parser is attempting to validate the XML document using the Map DTD. The xsi namespace and attribute are not defined in the DTDs.
Here is the FAQ that explains the validation algorithm.
http://xerces.apache.org/xerces2-j/faq-pcfp.html#faq-3
Eric
Eric A. Sirois
Staff Software Developer
DB2 Universal Database - Information Development
DITA Migration and Tools Development
IBM Canada Ltd. - Toronto Software Lab
Email: esirois-G1DYhSM1WHTQT0dZR+AlfA@public.gmane.org
Phone:(905) 413-2841
Blue Pages (Internal)
"Transparency and accessibility requirements dictate that public information and government
transactions avoid depending on technologies that imply or impose a specific product or
platform on businesses or citizens" - EU on XML-based office document formats.
| Grzegorz Junka <xgjx-wo4oW1Pw1HF3vZ0LZ0W7Rg@public.gmane.org>
Sent by: news <news-dbVV3NMTNubNLxjTenLetw@public.gmane.org> 05/26/2008 12:03 PM |
|
Grzegorz Junka <xgjx <at> ...> writes:
>
> Hi,
> I have a simple structure with some ditamaps and some topics, which I try to
> compile with 1.4.1 DITA open toolkit. The compilation fails because original
> schemas don't define attributes xmlns:xsi and xsi:noNamespaceSchemaLocation,
> which Serna adds to each created DITA file. Also the Publish command from Serna
> produces warnings for each such file.
>
> How can I configure Serna to not add not standard attributes to these files, or
> change relevant schemas in the toolkit directory so these attributes are
> recognized and don't produce any errors or warnings?
>
> Many thanks for your help in advance.
> Kind Regards
> Grzegorz Junka
>
Hi Eric,
Here is the error from DITA open toolkit:
----->
Unable to locate tools.jar. Expected to find it in C:\Program Files
(x86)\Java\jre1.6.0_03\lib\tools.jar
Buildfile: build_test.xml
(...)
check-arg:
[echo] *****************************************************************
[echo] * basedir = C:\DITA-OT1.4.1
[echo] * dita.dir = C:\DITA-OT1.4.1
[echo] * input = DITA\Root.ditamap
[echo] * transtype = xhtml
[echo] * tempdir = temp
[echo] * outputdir = DITA\_output
[echo] * extname = .xml
[echo] * clean.temp = true
[echo] * xslt.parser = XALAN
[echo] *****************************************************************
(...)
gen-list-without-flagging:
[pipeline] Using XERCES.
BUILD FAILED
C:\DITA-OT1.4.1\build_test.xml:117: The following error occurred while executing
this line:
C:\DITA-OT1.4.1\build_preprocess.xml:32: [DOTJ012F][FATAL] Failed to parse the
input file 'Root.ditamap' due to below ex
ception. Please correct the input base on the exception message.:Root.ditamap
Line 3:Attribute "xsi:noNamespaceSchemaLoc
ation" must be declared for element type "map".
Total time: 1 second
c:\DITA-OT1.4.1>
----->
Here are errors from Serna:
----->
(...)
check-arg:
[echo] *****************************************************************
[echo] * basedir = D:\Program Files
(x86)\Syntext\Serna-3.7\plugins\dita\DITA-OT1.4
[echo] * dita.dir = D:\Program Files
(x86)\Syntext\Serna-3.7\plugins\dita\DITA-OT1.4
[echo] * input = I:/DITA/publishTemp.520.ditamap
[echo] * transtype = xhtml
[echo] * tempdir = z:/_publishTemp.520.ditamap_
[echo] * outputdir = I:/DITA/_output
[echo] * extname = .xml
[echo] * clean.temp = ${clean.temp}
[echo] * xslt.parser = XALAN
[echo] *****************************************************************
(...)
gen-list-without-flagging:
[pipeline] Using XERCES.
[pipeline] [Error] :3:152: Attribute "xmlns:xsi" must be declared for element
type "map".
[pipeline] [Error] :3:152: Attribute "xsi:noNamespaceSchemaLocation" must be
declared for element type "map".
[pipeline] [Error] :3:132: Attribute "xmlns:xsi" must be declared for element
type "map".
[pipeline] [Error] :3:132: Attribute "xsi:noNamespaceSchemaLocation" must be
declared for element type "map".
[pipeline] [Error] :3:155: Attribute "xmlns:xsi" must be declared for element
type "concept".
[pipeline] [Error] :3:155: Attribute "xsi:noNamespaceSchemaLocation" must be
declared for element type "concept".
[pipeline] [Error] :3:155: Attribute "xmlns:xsi" must be declared for element
type "concept".
[pipeline] [Error] :3:155: Attribute "xsi:noNamespaceSchemaLocation" must be
declared for element type "concept".
[pipeline] [Error] :3:155: Attribute "xmlns:xsi" must be declared for element
type "concept".
[pipeline] [Error] :3:155: Attribute "xsi:noNamespaceSchemaLocation" must be
declared for element type "concept".
[pipeline] [Error] :3:155: Attribute "xmlns:xsi" must be declared for element
type "concept".
[pipeline] [Error] :3:155: Attribute "xsi:noNamespaceSchemaLocation" must be
declared for element type "concept".
gen-list-with-flagging:
gen-list:
debug:
[pipeline] [Error] Portals.ditamap:3:152: Attribute "xmlns:xsi" must be
declared for element type "map".
[pipeline] [Error] Portals.ditamap:3:152: Attribute
"xsi:noNamespaceSchemaLocation" must be declared for element type "map".
[pipeline] [Error] shopping.xml:3:155: Attribute "xmlns:xsi" must be declared
for element type "concept".
[pipeline] [Error] shopping.xml:3:155: Attribute
"xsi:noNamespaceSchemaLocation" must be declared for element type "concept".
[pipeline] [Error] Profiles.ditamap:3:132: Attribute "xmlns:xsi" must be
declared for element type "map".
[pipeline] [Error] Profiles.ditamap:3:132: Attribute
"xsi:noNamespaceSchemaLocation" must be declared for element type "map".
[pipeline] [Error] event.xml:3:155: Attribute "xmlns:xsi" must be declared for
element type "concept".
[pipeline] [Error] event.xml:3:155: Attribute "xsi:noNamespaceSchemaLocation"
must be declared for element type "concept".
[pipeline] [Error] product.xml:3:155: Attribute "xmlns:xsi" must be declared
for element type "concept".
[pipeline] [Error] product.xml:3:155: Attribute "xsi:noNamespaceSchemaLocation"
must be declared for element type "concept".
[pipeline] [Error] definition.xml:3:155: Attribute "xmlns:xsi" must be declared
for element type "concept".
[pipeline] [Error] definition.xml:3:155: Attribute
"xsi:noNamespaceSchemaLocation" must be declared for element type "concept".
----->
And here is the beginning of Root.ditamap:
----->
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd" []>
<map xsi:noNamespaceSchemaLocation="urn:oasis:names:tc:dita:xsd:concept.xsd:1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<title>The main root of all documents</title>
----->
When I remove both attributes:
xsi:noNamespaceSchemaLocation="urn:oasis:names:tc:dita:xsd:concept.xsd:1.1"
and
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
everything compiles without any problems
Thanks
GregJ
RSS Feed