gbXML file from Revit

Questions about XML that are not covered by the other forums should go here.
nana
Posts: 1
Joined: Tue Nov 20, 2012 11:55 pm

gbXML file from Revit

Post by nana »

Hi,
I have some questions about reading a XML file generated from Revit(a 3-D design software) in oXygen editor.

Here is what I do: A gbXML file is generated from Revit, and I am using a Matlab XML reading toolbox to read this gbXML file, and in Matlab, it shows errors as "XML parse error: Number of parentheses does not match.".

And I am trying to use oXygen editor to check to find the errors in the XML file. When I validate the XML file in oXygen, it says "There is no schema or DTD associated with the document. You can create an association either with the Associate Schema action or configuring in the Options the Preferences/Document Type Association list, or by creating a Validation Scenario." But it did not indicate where the problem is exactly. I would like to know whether I can find the errors "Number of parentheses does not match" in oXygen? And how can I find the mistakes?

Thanks!
Best,
Na
adrian
Posts: 2850
Joined: Tue May 17, 2005 4:01 pm

Re: gbXML file from Revit

Post by adrian »

Hello,

As the error message says, Oxygen needs a schema or a DTD in order to validate the file against it.
From the root declaration of your file (the one you have sent via email) it seems that the schema to be used for validation should be:
http://www.gbxml.org/schema/0-37/GreenBuildingXML.xsd
I recommend saving a local copy of this file and using that copy for validation.

There are several ways to configure Oxygen to validate with a schema:

1. The easiest way to do this is to associate a schema (or more schemas) with the document (this modifies the document, provides content completion and validate as you type).
Open the document and go to Document -> Schema -> Associate Schema (there's a corresponding action in the toolbar) and browse for the schema. The schema type will automatically be detected and used.

2. You can create a validation scenario (the document remains untouched, provides content completion and validate as you type):
- by opening an XML file and going to Document -> Validate -> Configure Validation Scenario (there's a corresponding action in the toolbar).
- by selecting an XML file in the Project view, right clicking on it and selecting Validate -> Configure Validation Scenario from the popup menu

In the Configure Validation Scenario dialog click New, choose a name for the scenario and configure the validation unit. Leave the URL of the file to validate unchanged (${currentFileURL}) so you can use the scenario for various XML files. Double click on the Schema field, select Use custom schema and browse for the schema. Close all dialogs with OK.

Afterwards you can associate multiple files from the project view with the custom validation scenario you have just configured. You can do this by selecting the XML files (or their parent folder) in the project view and right clicking and selecting Validate -> Configure Validation Scenario. Then select the scenario from the list and press OK. If you've chosen a folder this will associate the scenario with all the files from that folder (even if they are of other type than XML). So you should make sure you don't accidentally associate validation scenarios to files that the scenario won't apply to.

3. The quick way to validate with a schema if you only need to do this once and you won't be needing a scenario: Document -> Validate -> Validate with... and simply choose the schema. Or, in the Project view right click on the selected XML files(or folders) and from the contextual menu choose Validate -> Validate with Schema... and simply choose the schema. (You have to do it each time you want to validate).

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Post Reply