[xsd-users] XSD Parsing with different schema files

Boris Kolpackov boris at codesynthesis.com
Fri Nov 25 01:12:11 EST 2011


Hi Dominik,

In the future please keep your replies CC'ed to the xsd-users mailing
list as discussed in the posting guidelines:

http://www.codesynthesis.com/support/posting-guidelines.xhtml

Lickert, Dominik (LEN, DivHG) <DLickert at testo.de> writes:

> I think that isn't the solution. I tried to build my project with both
> variants, but also without success. I have an example of the XML file of
> Visio. The three separated schema files are linked to the xml file in the
> root element. For reminder: They are linked only in the XML file, not in the
> schema files!!!
> The elements of the two other schema files, of the namespace "extension",
> are:
> 	- "Event"
> 	- "Layout"
> 	- "Protection"
> (The content of the elements with a "+" in front of is comment out!!!)

I looked at the schemas and indeed they use the first approach I 
described (wildcards). In particular, look at the vx:Event element
under the Shape element in your sample XML. This element is allowed
by the xsd:any wildcard in ShapeSheet_Type (visio.xsd, line 157).


> My problem is now that the parsing process is interrupted at the point
> of the element '<vx:Event xmlns:vx="http://schemas.microsoft.com/visio/2006/extension"> '.
> At this point the parser go back to the element "Shape" and parse the next
> element after "Shape", in this case the element "Icon".

I am not sure what you mean by "interrupted". If you compiled your schemas
with the --generate-wildcard option (and following other instructions from
the 'wildcard' example), then the content corresponding to the vx:Event
element will be stored in the object model as a DOM fragment. This fragment
can then be parsed into the object model fragment, again, as shown in the
'wildcard' example.


> I hope now it's more clear what I meant. Please ask if not, it's 
> difficult to explain.
> 
> I added the three schema files.
> The download-link of the schema files is here:
> http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=23976
> 
> One further problem are errors during the building. The point the 
> redefinition of a lot of classes. I know that one solution is to map
> them with the "--namespace-map" attribute, but I think this is the 
> wrong way, isn't it? I think this is the information to the solution.

The vision.xsd schema declarations are placed into the 'core' C++ 
namespace, while both visio12.xsd and visio14.xsd are both mapped
to the 'extension' C++ namespace. So, yes, you will need to use the
--namespace-map option to map the last two files to different C++
namespaces.

Boris

> 
> 
> VISIO_XML EXAMPLE:
> 
> 
> <?xml version="1.0" encoding="utf-8" ?> 
> - <VisioDocument key="A460E913A6AF6C5FA0DB212B7FC70B639F5870EDB0FB9599DB482701FEE69788735E4A93C3D6B37BD647EE11E1E67496F7EB175E609B80DF7052ADC6844FE6BC" start="190" metric="0" DocLangID="1031" buildnum="6106" version="14.0" xml:space="preserve" xmlns="http://schemas.microsoft.com/visio/2003/core" xmlns:vx="http://schemas.microsoft.com/visio/2006/extension" xmlns:v14="http://schemas.microsoft.com/office/visio/2010/extension">
> 	+ <DocumentProperties>
> 	+ <DocumentSettings TopPage="0" DefaultTextStyle="7" DefaultLineStyle="7" DefaultFillStyle="7" DefaultGuideStyle="4">
> 	+ <Colors>
> 	+ <FaceNames>
> 	+ <StyleSheets>
> 	+ <StyleSheet ID="0" NameU="No Style" Name="Keine Format">
> 	+ <DocumentSheet NameU="TheDoc" Name="TheDoc" LineStyle="0" FillStyle="0" TextStyle="0">
> 	- <Masters>
> 		- <Master ID="0" NameU="Process" Name="Prozess" Prompt="Ziehen Sie das Shape auf das Zeichenblatt." IconSize="1" AlignName="2" MatchByName="0" IconUpdate="0" 				UniqueID="{1FBE7366-0000-0000-8E40-00608CF305B2}" BaseID="{5533023F-8494-4A6B-97B7-1BCC6B7DF262}" PatternFlags="0" Hidden="0">
> 			+ <PageSheet LineStyle="0" FillStyle="0" TextStyle="0">
> 			+ <PageProps>
> 			+ <PrintProps>
> 			+ <Misc>
> 			+ <Layer IX="0">
> 			- <Shapes>
> 				- <Shape ID="4" Type="Shape" LineStyle="7" FillStyle="7" TextStyle="7" UniqueID="{FE76A3BB-6DCD-48EE-8107-0159B90C6216}">
> 					+ <XForm>
> 					- <Event>
>   						<TheData F="No Formula">0</TheData> 
> 						<TheText F="No Formula">0</TheText> 
> 						<EventDblClick F="OPENTEXTWIN()">0</EventDblClick> 
>   						<EventXFMod F="No Formula">0</EventXFMod> 
>  						 <EventDrop F="No Formula">0</EventDrop> 
>  					 </Event>
> 					- <vx:Event xmlns:vx="http://schemas.microsoft.com/visio/2006/extension">
>   						<vx:EventMultiDrop F="No Formula">0</vx:EventMultiDrop> 
>   					</vx:Event>
> 					+ <Help>
> 					+ <LayerMem>
> 					+ <Misc>
> 					+ <Layout>
> 					+ <vx:Layout xmlns:vx="http://schemas.microsoft.com/visio/2006/extension">
> 					+ <v14:Layout xmlns:v14="http://schemas.microsoft.com/office/visio/2010/extension">
> 					+ <Protection>
> 					+ <vx:Protection xmlns:vx="http://schemas.microsoft.com/visio/2006/extension">
> 					+ <Connection IX="0">
> 					+ <Connection IX="1">
> 				...
>  			 </Shapes>
>   			<Icon>AAABAAEAICAQAAAAAADoAgAAFgAAACgAAAAgAAAAQAAAAAEABAAAAAAAgAIAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAgICAAMDAwAAAAP8AAP8AAAD//wD/AAAA/w D/AP//AAD///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAB3d3d3d3d3d3d3d3cAAAAAAAAAAAAAAAAAAAAHAAAAAP//////////////BwAAAAD //////////////wcAAAAA//////////////8HAAAAAP//////////////BwAAAAD///////////// /wcAAAAA//////////////8HAAAAAP//////////////BwAAAAD//////////////wcAAAAA///// /////////8HAAAAAP//////////////BwAAAAD//////////////wcAAAAA//////////////8HAA AAAP//////////////BwAAAAD//////////////wcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAD/////////////////////////////////////+AAAB/AAAAfwAAAH8AAAB/AAAAfwAAAH8AAA B/AAAAfwAAAH8AAAB/AAAAfwAAAH8AAAB/AAAAfwAAAH8AAAB/AAAA/////////////////////// ////////////////////w==
> 			</Icon>
> 
> Thank you,
> Best Regards
> Dominik



More information about the xsd-users mailing list