Validating Autodesk Volview

Having trouble installing Oxygen? Got a bug to report? Post it all here.
Guest

Validating Autodesk Volview

Post by Guest »

When trying to validate a document created in Autodesk's VoloView, I get the following message:

E cvc-elt.1: Cannot find the declaration of element 'RedlineXML'. andrew_test.xml file:/home/andrew/sample_data/andrew_test.xml 2:1

These are the first two lines of the xml file. Can anyone point me in the right direction of of what is going on? Also would this be the reason why an XPath query for /* returns /RedlineXML[1], whilst a query for /RedlineXML[1] returns no results?

Many thanks,

A

<?xml version="1.0" encoding="UTF-8"?>
<RedlineXML xmlns="urn:autodesk_com:dsd:RedlineXML_v_002.xdr" xmlns:redline="urn:autodesk_com:dsd:RedlineXML_v_002.xdr" xmlns:VoloView="urn:autodesk_com:dsd:VoloView_v_001.xdr" xmlns:acdb="urn:autodesk_com:dsd:RMLFilterAcDb_v_001.xdr">
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi,

In order to validate an XML document with an XML Schema you need to associate that schema with the document. This is done using the schemaLocation attribute from the http://www.w3.org/2001/XMLSchema-instance namespace. Something like below:

Code: Select all


<ipo:purchaseOrder orderDate="1999-12-01" xmlns:ipo="http://www.example.com/IPO"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.example.com/IPO ipo.xsd">

</ipo:purchaseOrder>
Also note that XDR schemas are deprecated. XDR was a Microsoft schema language but was dropped in favor of W3C XML Schema. Oxygen does not support XDR.

Regarding the XPath issue. This is a FAQ. XPath does not know default namespaces, so when you have:

/RedlineXML[1]

that means RedlineXML from no namespace. Your document contains a RedlineXML element but it is from the urn:autodesk_com:dsd:RedlineXML_v_002.xdr namespace so the XPath expression does not match it.

You need a prefix to access any node that belongs to a namespace. Oxygen will map the default namespace to the first unused prefix from {default, default1, default2, ...} so if you try

/default:RedlineXML[1]

it should work.

Best Regards,
George
Andrew
Posts: 1
Joined: Tue Nov 23, 2004 8:55 pm

Post by Andrew »

Many thanks for the reply.

I've tried running an XPath search for

/default:RedlineXML[1]

but I just get the following exception:

"Exception: ro.sync.goto.do
Prefix must resolve to a namespace: default"

:(
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi Andrew,

Please make sure you have oXygen 5 as this feature was added recently. Also you should have a default namespace in your document, for instance if the document is:

<RedlineXML xmlns="urn:autodesk_com:dsd:RedlineXML_v_002.xdr" xmlns:redline="urn:autodesk_com:dsd:RedlineXML_v_002.xdr" xmlns:VoloView="urn:autodesk_com:dsd:VoloView_v_001.xdr" xmlns:acdb="urn:autodesk_com:dsd:RMLFilterAcDb_v_001.xdr"/>

Then /default:RedlineXML[1] will give 1 result.

Best Regards,
George
Post Reply