[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ant-user
Subject:    Re: Ant 1.8.2 schemavalidate and xmlcatalog
From:       Susanne Wunsch <apache-ant () uriah ! heep ! sax ! de>
Date:       2012-05-23 7:04:55
Message-ID: m1zk8zcr8o.fsf () cygnus ! heep ! sax ! de
[Download RAW message or body]

Hello,

polymorphisme <webmaster@polymorphisme.org> writes:

> I'm very interest by this task :)
> I'm working too with the Dublin Core. 
> And I have an example :
>
> <?xml version="1.0" encoding="UTF-8"?>
> <my:simpledc xmlns:my="http://example.org/appsimpledc/" 
>   xmlns:dc="http://purl.org/dc/elements/1.1/" 
>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>   xsi:noNamespaceSchemaLocation="simpledc.xsd">
> 	
> 	<dc:tite>Test the appsimpledc.xsd</dc:tite>
> 	<dc:creato>Tim Cole</dc:creato>
> 	<dc:creator>Tom Habing</dc:creator>
> </my:simpledc>
>
> I can't validate this code.
> And I'm looking for an good example. If you have one ... it's sweet. 

xxx:tmp susi$ cat simpledc.xml 
<?xml version="1.0" encoding="UTF-8"?>
<my:simpledc xmlns:my="http://example.org/appsimpledc/" 
  xmlns:dc="http://purl.org/dc/elements/1.1/" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="simpledc.xsd">	
	<dc:tite>Test the appsimpledc.xsd</dc:tite>
	<dc:creato>Tim Cole</dc:creato>
	<dc:creator>Tom Habing</dc:creator>
</my:simpledc>

xxx:tmp susi$ cat build.xml 
<?xml version="1.0"?>
<project name="validation-test" basedir="/tmp" default="validate">
  <target name="validate">
    <schemavalidate failonerror="true" file="simpledc.xml">
      <schema namespace="http://purl.org/dc/elements/1.1/" file="dc.xsd"/>
      <attribute name="http://xml.org/sax/features/validation" value="true"/>
      <attribute name="http://apache.org/xml/features/validation/schema" value="true"/>
      <attribute name="http://xml.org/sax/features/namespaces" value="true"/>
      <attribute name="http://xml.org/sax/features/namespace-prefixes" value="true"/>
    </schemavalidate>
  </target>
</project>

Copied the official dc.xsd into /tmp.

xxx:tmp susi$ ant
Buildfile: /tmp/build.xml

validate:
[schemavalidate] /tmp/simpledc.xml:5:48: cvc-elt.1: Cannot find the declaration of element 'my:simpledc'.

BUILD FAILED
/private/tmp/build.xml:4: /tmp/simpledc.xml is not a valid XML document.

Total time: 1 second

That's all ... I hope it helps...

Kind regards...
Susanne

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic