Search found 264 matches

by Patrik
Thu Apr 30, 2015 9:24 am
Forum: SDK-API, Frameworks - Document Types
Topic: Automatically add specific optional elements
Replies: 17
Views: 8353

Automatically add specific optional elements

Hi, When I insert a new element oXygen will add all mandatory child elements as well, which is very nice. Now It occurs increasingly often that I add new elements to the xsd. To be downward compatible (i.e. not having to adapt all older documents), I don't want these new elements to be mandatory. Bu...
by Patrik
Tue Apr 28, 2015 4:16 pm
Forum: SDK-API, Frameworks - Document Types
Topic: Load xml file "weak"-schema-aware
Replies: 4
Views: 1811

Re: Load xml file "weak"-schema-aware

Thanks for the documentation. It worked but I realized that I need the to resolve the xincludes. However, adding an empty fallback in all xincludes is a sufficient alternative.

Regards,
Patrik
by Patrik
Tue Apr 28, 2015 2:27 pm
Forum: SDK-API, Frameworks - Document Types
Topic: Load xml file "weak"-schema-aware
Replies: 4
Views: 1811

Re: Load xml file "weak"-schema-aware

Hi Alex, thanks for the code. It works nicely for the common validation errors (missing elements, dublicate ids). But a failed xinclude still aborts loading the file. Is there maybe a way to keep the xincludes from being resolved at all? I could easily do this in my own java code. BTW: The class Par...
by Patrik
Sat Apr 25, 2015 4:44 pm
Forum: SDK-API, Frameworks - Document Types
Topic: Load xml file "weak"-schema-aware
Replies: 4
Views: 1811

Load xml file "weak"-schema-aware

Hi, I'm using ParserCreator.newSchemaAwareDocumentBuilder() to load the complete book in my custom framework from java. Now it occurs quite often, that a small (and easily recoverable) bug in the xml code (non-unique id, missing included file, missing mandatory element, ...) keeps the file from bein...
by Patrik
Tue Apr 14, 2015 7:37 am
Forum: General XML Questions
Topic: check schema for fixed attribute
Replies: 7
Views: 3951

Re: check schema for fixed attribute

Hi Lionel, you could load the file schema-aware. This way all the default and fixed attributes are expanded. But you won't be able to identify if an attribute was already set in the xml or has been added as default attribute. Here's my (simplified) code to do this: import javax.xml.parsers.DocumentB...
by Patrik
Fri Apr 10, 2015 9:31 am
Forum: Common Problems
Topic: NPE when validating during automatic validation
Replies: 2
Views: 1087

Re: NPE when validating during automatic validation

Hi Ionela,

I created a simplified sample that produces this behavior reliably on 16.0. However, with Oxygen 16.1 (which I installed parallel for tests) the error no more occurs. So I hope the problem will be solved when we all move on to Oxygen 17.0.

Thanks and regards,
Patrik
by Patrik
Fri Apr 10, 2015 8:04 am
Forum: Common Problems
Topic: Unspecific schematron message with inconsistent schemaLocati
Replies: 4
Views: 1624

Re: Unspecific schematron message with inconsistent schemaLo

Hi Octavian,

the behavior occurs on both my installation: 16.0 (build 2014070913) and 16.1 (build 2014112517), but only with "Use Saxon EE (schema aware) for xslt2 query binding" enabled. Unchecking this setting the schematron validation is being executed successfully.

Thanks and regards,
Patrik
by Patrik
Thu Apr 09, 2015 9:47 am
Forum: Common Problems
Topic: NPE when doing document type validation with invalid xsd
Replies: 3
Views: 1128

Re: NPE when doing document type validation with invalid xsd

Just for the record: It turned out that quite some additional conditions had to be metto produce this error. I sent a sample by email.

Regards,
Patrik
by Patrik
Thu Apr 09, 2015 8:27 am
Forum: XML Schemas
Topic: Add exception handling to schematron
Replies: 3
Views: 3090

Re: Add exception handling to schematron

Hi Tavy, keeping queryBinding on xslt2 and adding an additional parameter "exception-handling" instead indeed solved this problem. Thanks for that. Unfortunately, now the next problem arised: When executing the generated script during validation, document('') does not return the xslt code (which I n...
by Patrik
Wed Apr 08, 2015 11:30 am
Forum: Common Problems
Topic: Unspecific schematron message with inconsistent schemaLocati
Replies: 4
Views: 1624

Unspecific schematron message with inconsistent schemaLocati

Following (invalid but still occuring) scenario: Root.xml: <Root xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns:xi = "http://www.w3.org/2001/XInclude" xsi:noNamespaceSchemaLocation="Root.xsd"> <xi:include href="Child.xml"/> </Root> Child.xml: <Child xmlns:xsi = "http://www.w3.org/2001...
by Patrik
Wed Apr 08, 2015 10:50 am
Forum: Common Problems
Topic: NPE when doing document type validation with invalid xsd
Replies: 3
Views: 1128

NPE when doing document type validation with invalid xsd

Hi, when I validate an xml document against an invalid schema (xsd) I usually get error messages about the error in the schema, which is what I'd expect. However, when I'm validating an xml document using a validation scenario configured in a framework that uses an invalid schema, I get a message bo...
by Patrik
Wed Apr 08, 2015 10:13 am
Forum: Common Problems
Topic: NPE when validating during automatic validation
Replies: 2
Views: 1087

NPE when validating during automatic validation

Hi, Since we have quite large files and complex validation scenarios (including several schematron rules) the validation can take some seconds. Now when opening a document the automatic validation starts. When starting a validation manually before the automatic one has completed I get a message box ...
by Patrik
Wed Apr 08, 2015 9:58 am
Forum: XML Schemas
Topic: Add exception handling to schematron
Replies: 3
Views: 3090

Add exception handling to schematron

Hi, currently it can be quite difficult to find the responsible code when an exception occurs during schematron validation. Thus, I modified the skeleton script to support queryBinding "xslt3". In this mode the execution of each pattern is surrounded by an xsl:try. In the xsl:catch it reports the er...
by Patrik
Thu Apr 02, 2015 10:45 am
Forum: XML Schemas
Topic: Multi-file Schematron architecture
Replies: 7
Views: 6688

Re: Multi-file Schematron architecture

Hi Radu,

thanks for the hint. I could just replace my include-schema with extends and it worked the same way. Thus, my include-schema is obsolete.

Regards,
Patrik
by Patrik
Tue Mar 31, 2015 6:15 pm
Forum: Common Problems
Topic: Sharing frameworks - Using variables in paths
Replies: 6
Views: 1733

Re: Sharing frameworks - Using variables in paths

Hi Stefan, there's no point in using variables in the storage path since this path is no parameter that is stored in the settings or something. It is simple a location on the harddisk. To share frameworks with other computers you have to share the content of the specific frameworks folder and config...
by Patrik
Tue Mar 31, 2015 3:17 pm
Forum: Common Problems
Topic: Sharing frameworks - Using variables in paths
Replies: 6
Views: 1733

Re: Sharing frameworks - Using variables in paths

Hi Stefan,

I solved the problem by using an environment variable that needs to be set on every machine (not only for oXygen). Then you can refer to it with ${env(VariableName)}/OxygenFrameworks.

Regards,
Patrik
by Patrik
Mon Mar 30, 2015 7:10 pm
Forum: SDK-API, Frameworks - Document Types
Topic: custom functions/instructions in xslt content completion
Replies: 7
Views: 3402

Re: custom functions/instructions in xslt content completion

Hi Adrian, this seems to work only for functions within the saxon namespace. I added the folowing code for testing: <function> <name>saxon:test-saxon</name> <namespace>http://saxon.sf.net/</namespace> <signature> <return>xs:string*</return> </signature> <description xml:space="preserve">Test-Functio...
by Patrik
Sun Mar 29, 2015 11:18 am
Forum: XML Schemas
Topic: schema aware schematron in xsd
Replies: 2
Views: 2889

Re: schema aware schematron in xsd

I managed to make it work by modifying the schematron xslt scripts. If someone is interested I'd gladly share the code. (Some more modifications were neccessary.)

It might as well me a nice feature to add "schema aware" as a schematron configuration parameter to oxygen.

Regards,
Patrik
by Patrik
Sat Mar 28, 2015 7:35 pm
Forum: SDK-API, Frameworks - Document Types
Topic: custom functions/instructions in xslt content completion
Replies: 7
Views: 3402

custom functions/instructions in xslt content completion

Hi, I have implemented some custom functions for saxon xslt and will add some custom instructions as well. Is there any way I can add these to the content completion? I noticed that the custom functions in the saxon namespace are already included while the saxon instructions are not!? Thanks and reg...
by Patrik
Sat Mar 28, 2015 6:59 pm
Forum: XML Schemas
Topic: Multi-file Schematron architecture
Replies: 7
Views: 6688

Re: Multi-file Schematron architecture

Hi, I had a similar problem with a growing schematron file I'd like to split. Since it seems like there wont be a new schematron version any time soon I modified the files included in oxygen myself. Maybe you could consider adding this to the oxygen distribution as well: customized-iso-schematron.xs...
by Patrik
Sat Mar 28, 2015 3:45 pm
Forum: XML Schemas
Topic: Further development on schematron
Replies: 13
Views: 5755

Re: Further development on schematron

I figured out why it was not working with schematronDispatcher.xsl: When doing schematron validation oxygen does not use the file schematronDispatcher.xsl directly but oXygenSchematronDispatcher.xsl. And this file imports schematronDispatcher.xsl with a relative path and, thus, within the oxygen.jar...
by Patrik
Sat Mar 28, 2015 10:29 am
Forum: XML Schemas
Topic: Finding the code from schematorn message
Replies: 3
Views: 2317

Re: Finding the code from schematorn message

After diving a little deeper into schematron I found out that it's actually quite easy to add the location information to the messages. I simply added the following code to the template "process-message": <xsl:if test="$show-code-pos = 'true'"> <axsl:text> <xsl:text> [filename: </xsl:text> <xsl:valu...
by Patrik
Fri Mar 27, 2015 5:21 pm
Forum: XML Schemas
Topic: Further development on schematron
Replies: 13
Views: 5755

Re: Further development on schematron

I did copy all the xsl files, so it needs to be something else...

For testing I modified the files in the oxygen.jar/builtin and I worked - wouldn't be my preferred solution though.

Regards,
Patrik
by Patrik
Fri Mar 27, 2015 12:23 pm
Forum: XML Schemas
Topic: Further development on schematron
Replies: 13
Views: 5755

Re: Further development on schematron

I did as you told me - all without any effect. :(

Maybe you could give me a file (xsl, zip, jar or whatever is necessary) with any(!) noticable modification in schematronDispatcher that you tested successfully?

Thanks and regards,
Patrik
by Patrik
Fri Mar 27, 2015 12:18 am
Forum: XSLT and FOP
Topic: How does XSLT utilize prefixed attributes from a separate so
Replies: 5
Views: 2415

Re: How does XSLT utilize prefixed attributes from a separat

Sorry, but I can't help you since I don't understand what you actually want and my assumptions appear to be wrong.

Regards,
Patrik
by Patrik
Thu Mar 26, 2015 7:10 pm
Forum: Feature Request
Topic: Create XInclude from Selection
Replies: 2
Views: 1840

Re: Create XInclude from Selection

It's quite easy to implement a custom author action using XsltOperation. The limits of my implementation: - The author can't enter the filename. It is rather generated from the title. - Thus it is limited to elements with a title element. - It doesn't use the selectionbut takes the first suitable an...
by Patrik
Thu Mar 26, 2015 6:26 pm
Forum: XML Schemas
Topic: Further development on schematron
Replies: 13
Views: 5755

Re: Further development on schematron

I successfully modified the iso-schematron-message.xsl. And the changes are in effect even without restarting oxygen. However, modifying the schematronDispatcher.xsl or XSD2Schtrn.xsl didn't have any effect so far - even after restarting oxygen. For instance in XSD2Schtrn.xsl I replaced line 80 (in ...
by Patrik
Thu Mar 26, 2015 5:42 pm
Forum: XSLT and FOP
Topic: How does XSLT utilize prefixed attributes from a separate so
Replies: 5
Views: 2415

Re: How does XSLT utilize prefixed attributes from a separat

Of course you could adapt the existing stylesheet as well by droping the joe-attibutes and directly formatting the values. But I understood that you WANT to use another transformation...