At 2009-03-19 15:03 +0100, Romain Pelisse wrote:
Well basicly, the idea is to use the XSL Filter to transform some of my customer specific XML datafile into something that OOo can displays. To ensure the user does not import an invalid XML file, we just want, prior to running the XSL transformation itself,
*That* was what I didn't read the first time.
to check if the XML file loaded is valid according to my customer XSD. * Validation * *Currently, no XML validation takes place during the import or export of documents. * ... but maybe this refers to something else ?
Perhaps it might be worded better as "no XML validation is available during the import or export of documents". Validation in XSLT 2.0 is *not* automatic. As I mentioned in my earlier post, not only must you turn it on in XSLT 2.0 invocation, you must also *change* the stylesheet to engage it.
Also, were you aware that "turning on validation" also requires changes to > an XSLT stylesheet to engage the validation features? Not only will you > need to install a schema-aware processor, and change the invocation to turn > on validation, but you also need import statements in the XSLT to pull in > the type definitions that your validation instructions refer to in order to > indicate the validation you want. > > BTW, there may very well be other validating W3C Schema processors out > there, but I'm not aware of them so I've not used them. > I'm confused again here... It sounds like you think I want to validate the XSLT itself !
Not at all. All I was trying to warn you about is that in XSLT 2.0, turning on validation does *not* mean "validate the input and result documents". It only turns on the facility for a stylesheet to engage such validation under stylesheet control.
All I want here is to prior to import/export.
Forgive me for misreading your initial post. I mistakenly thought you were talking about validation *in* the XSLT process invoked by the filter.
From my point of view, the XSLT filter is not even load in memory when this happens.
I misunderstood. Perhaps because I am in the middle of teaching this stuff my focus was off the mark.
Here is what would like OOo to do when I import one of our file: 1. Load the File 2. Validate that the file is valid regarding an XSD 3. If the file is OK, run the transformation (no validation during this part). 4. Render the doc, work on it. 5. Run the export filter 6. Validate that the exported file is still valid From my point of view, it sounds like a very simple use case, and it does not seems so hard to implement.
Absolutely the way you describe it this would be a feature of the OpenOffice filter and not a feature of the XSLT processor. In my defense, please note that the other respondent also misunderstood your requirement and suggested Saxon-SA.
In fact, i'm wondering what is not already implemented ! Just validate the XML document either with an embedded URL to the appropriate XSD (requires connexion) or simply by validating it with a ship in XSD. Then, run the XSL transformation... That's all.
Thank you for clarifying your requirement.
But again, maybe i got this wrong, maybe an XSD validation can occur when you import/export XML file...
I am unfamiliar with the implementation of OpenOffice filters to know if or how easy it is to be available. Certainly the filter interface does not offer the specification of XSD schemas to use on import and export.
I would certainly support a feature request for OpenOffice filters to specify such artefacts and have them incorporated in the JAR and engaged on import and export.
Again, I apologize for having misunderstood your requirement. I fully support such a new feature.
. . . . . . . . . . Ken -- XSLT/XQuery/XSL-FO training in Los Angeles (New dates!) 2009-06-08 Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video Video lesson: http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18 Video overview: http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18 G. Ken Holman mailto:[email protected] Crane Softwrights Ltd. http://www.CraneSoftwrights.com/i/ Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/i/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
