Eric Sirois | 27 May 18:54

Re: [Serna] Compiling non-standard attributes with DITA open toolkit


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

To
Eric Sirois/Toronto/IBM <at> IBMCA
cc
news <news-dbVV3NMTNubNLxjTenLetw@public.gmane.org>, serna-users-YYLLxrGCLz9BDgjK7y7TUQ@public.gmane.org
Subject
Re: [Serna]  Compiling non-standard attributes with DITA open toolkit





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


To
serna-users-YYLLxrGCLz9BDgjK7y7TUQ@public.gmane.org
cc
Subject
Re: [Serna]  Compiling non-standard attributes with DITA open toolkit







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



Paul Antonov | 27 May 19:08
Favicon

Re: [Serna] Compiling non-standard attributes with DITA open toolkit


Hello Grzegorz & Eric,

if you do not need xsi:noNamespaceSchemaLocation in new DITA documents 
created by Serna, you can just remove these attributes from respective 
document skeletons in $SERNA_INSTALL_DIR/plugins/dita/*.sdt files.

Regards,

-- Paul

On Tue, 27 May 2008, 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@...
> 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@...>
> 05/26/2008 02:52 PM
>
> To
> Eric Sirois/Toronto/IBM <at> IBMCA
> cc
> news <news@...>, serna-users@...
> Subject
> Re: [Serna]  Compiling non-standard attributes with DITA open toolkit
>
>
>
>
>
>
> 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@...
> 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@...>
> Sent by: news <news@...>
> 05/26/2008 12:03 PM
>
>
> To
> serna-users@...
> cc
>
> Subject
> Re: [Serna]  Compiling non-standard attributes with DITA open toolkit
>
>
>
>
>
>
>
>
> Grzegorz Junka <xgjx@...> 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
>
>
>
> To unsubscribe send empty e-mail to: serna-users-unsubscribe@...
>
>
>
>


Gmane