You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Hammer-Lahav, Eran [CIB-IT]" <er...@citigroup.com> on 2007/01/05 20:23:56 UTC

Adding Schema Validation with command line Name Space option

I am new to the list and am not sure if this has been previously
addressed (I tried to search the archive but did not find this directly
covered). I am using Xalan for automatic C++ code generation with XML
class definitions. I had a need for the transformation to both validate
the input XML files against their schema, as well as load all default
values into the processing engine so they will be available for XSLT
conversion.

 

I found an easy way to do that by making small changes to the Process
class (changes are partially a hack as they might introduce side-effects
for other features I am not using) to allow providing a schema namespace
via the command line and enabling validation. I saw in a few on-line
forums that others have been looking to achieve that without having to
make code changes. I am not a Java developer and am not familiar with
the Xalan codebase enough to make these changes but you can see from the
attached file what I have done.

 

It would be great is such a Schema Name Space feature can be added to
activate validation and also override of the schema used (useful when
the schema is in a local directory and cannot be hardcoded into the XML
file due to network drive naming issues).

 

Thanks,

 

EHL


Re: Adding Schema Validation with command line Name Space option

Posted by Kevin Cormier <kc...@ca.ibm.com>.
Hi Eran,

The Process command line utility is a very basic driver for performing
simple transformations; it is expected that users with more sophisticated
needs will likely use a custom driver that performs transformations using
the JAXP interfaces.  Currently, there is no option to turn on validation
even when the schema or reference thereto is hard-coded in the XML
document.  I think it is unlikely that we would include your feature on the
Process driver unless there is evidence of very high demand for it,
especially since validation concerns the XML parser, not the XSLT
processor.

Of course, you are welcome to use a modified version of Process or to write
your own driver.  A sample that shows how to turn on validation (although
DTD based) is provided in samples/Validate.

Kevin Cormier
Software Developer, XSLT Development
E-mail:  kcormier@ca.ibm.com


                                                                           
             "Hammer-Lahav,                                                
             Eran [CIB-IT]"                                                
             <eran.hammerlahav                                          To 
             @citigroup.com>           <xa...@xml.apache.org>          
                                                                        cc 
             01/05/2007 02:23                                              
             PM                                                    Subject 
                                       Adding Schema Validation with       
                                       command line Name Space option      
             Please respond to                                             
             xalan-dev@xml.apa                                             
                  che.org                                                  
                                                                           
                                                                           
                                                                           




I am new to the list and am not sure if this has been previously addressed
(I tried to search the archive but did not find this directly covered). I
am using Xalan for automatic C++ code generation with XML class
definitions. I had a need for the transformation to both validate the input
XML files against their schema, as well as load all default values into the
processing engine so they will be available for XSLT conversion.

I found an easy way to do that by making small changes to the Process class
(changes are partially a hack as they might introduce side-effects for
other features I am not using) to allow providing a schema namespace via
the command line and enabling validation. I saw in a few on-line forums
that others have been looking to achieve that without having to make code
changes. I am not a Java developer and am not familiar with the Xalan
codebase enough to make these changes but you can see from the attached
file what I have done.

It would be great is such a Schema Name Space feature can be added to
activate validation and also override of the schema used (useful when the
schema is in a local directory and cannot be hardcoded into the XML file
due to network drive naming issues).

Thanks,

EHL(See attached file: ProcessSNS.java)
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org

Re: Adding Schema Validation with command line Name Space option

Posted by Erin Harris <eh...@ca.ibm.com>.
Hi,

If you like you can open a new feature at 
https://issues.apache.org/jira/browse/XALANJ

Thanks.

Erin Harris





"Hammer-Lahav, Eran [CIB-IT]" <er...@citigroup.com> 
05/01/2007 02:23 PM
Please respond to
xalan-dev@xml.apache.org


To
<xa...@xml.apache.org>
cc

Subject
Adding Schema Validation with command line Name Space option






I am new to the list and am not sure if this has been previously addressed 
(I tried to search the archive but did not find this directly covered). I 
am using Xalan for automatic C++ code generation with XML class 
definitions. I had a need for the transformation to both validate the 
input XML files against their schema, as well as load all default values 
into the processing engine so they will be available for XSLT conversion.
 
I found an easy way to do that by making small changes to the Process 
class (changes are partially a hack as they might introduce side-effects 
for other features I am not using) to allow providing a schema namespace 
via the command line and enabling validation. I saw in a few on-line 
forums that others have been looking to achieve that without having to 
make code changes. I am not a Java developer and am not familiar with the 
Xalan codebase enough to make these changes but you can see from the 
attached file what I have done.
 
It would be great is such a Schema Name Space feature can be added to 
activate validation and also override of the schema used (useful when the 
schema is in a local directory and cannot be hardcoded into the XML file 
due to network drive naming issues).
 
Thanks,
 
EHL---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org