-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
189 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
PUBLIC "http://www.w3.org/XML/1998/namespace" "maven:com.helger.xsd:ph-xsds-xml:jar::!/schemas/xml.xsd" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
ph-schematron-xslt/src/test/java/com/helger/schematron/supplementary/Issue085Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/** | ||
* Copyright (C) 2014-2020 Philip Helger (www.helger.com) | ||
* philip[at]helger[dot]com | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.helger.schematron.supplementary; | ||
|
||
import static org.junit.Assert.assertNotNull; | ||
|
||
import java.io.File; | ||
|
||
import javax.annotation.Nonnull; | ||
|
||
import org.junit.Test; | ||
|
||
import com.helger.commons.io.resource.FileSystemResource; | ||
import com.helger.schematron.sch.SchematronResourceSCH; | ||
import com.helger.schematron.svrl.SVRLMarshaller; | ||
import com.helger.schematron.svrl.jaxb.SchematronOutputType; | ||
import com.helger.xml.serialize.write.XMLWriter; | ||
|
||
public final class Issue085Test | ||
{ | ||
@Test | ||
public void testIssue () throws Exception | ||
{ | ||
validateAndProduceSVRL (new File ("src/test/resources/issues/github85/schematron.sch"), | ||
new File ("src/test/resources/issues/github85/test.xml")); | ||
} | ||
|
||
public static void validateAndProduceSVRL (@Nonnull final File aSchematron, final File aXML) throws Exception | ||
{ | ||
final SchematronResourceSCH aSCH = SchematronResourceSCH.fromFile (aSchematron); | ||
|
||
if (false) | ||
System.out.println (XMLWriter.getNodeAsString (aSCH.getXSLTProvider ().getXSLTDocument ())); | ||
|
||
// Perform validation | ||
final SchematronOutputType aSVRL = aSCH.applySchematronValidationToSVRL (new FileSystemResource (aXML)); | ||
assertNotNull (aSVRL); | ||
if (false) | ||
System.out.println (new SVRLMarshaller ().getAsString (aSVRL)); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
ph-schematron-xslt/src/test/resources/issues/github85/schematron.sch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<sch:schema xmlns="http://purl.oclc.org/dsdl/schematron" xmlns:sch="http://purl.oclc.org/dsdl/schematron" | ||
queryBinding="xslt2" schemaVersion="ISO19757-3"> | ||
<sch:title>ISO schematron validation file for descriptive extended constraints</sch:title> | ||
|
||
<sch:pattern> | ||
<sch:rule context="/"> | ||
<sch:report test="true()" diagnostics="d1" /> | ||
</sch:rule> | ||
</sch:pattern> | ||
<sch:diagnostics> | ||
<sch:diagnostic id="d1" xml:lang="de">Foobar</sch:diagnostic> | ||
</sch:diagnostics> | ||
|
||
</sch:schema> |
20 changes: 20 additions & 0 deletions
20
ph-schematron-xslt/src/test/resources/issues/github85/test.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<file> | ||
<Customer> | ||
<firstname> abc</firstname> | ||
<ContactDetails> | ||
<mobile>12345</mobile> | ||
<mobile></mobile> | ||
</ContactDetails> | ||
<ContactDetails> | ||
<mobile>12345</mobile> | ||
<mobile></mobile> | ||
</ContactDetails> | ||
</Customer> | ||
<Customer> | ||
<firstname> abc</firstname> | ||
<ContactDetails> | ||
<mobile></mobile> | ||
</ContactDetails> | ||
</Customer> | ||
</file> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters