Hello, polymorphisme <webmas...@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-unsubscr...@ant.apache.org For additional commands, e-mail: user-h...@ant.apache.org