[OSGeo-Discuss] XML to GML XSLT

"René A. Enguehard" ahugenerd at gmail.com
Wed Jun 10 10:59:15 PDT 2009


Hi all,

I've been working on getting an XML document to transform into a GML 
document. Currently I'm running into two issues:

1. How do we define the XSD rules for a string node with an attribute? 
ie: <point dimension="2">12.12, 34.34</point>
    Currently all I have found relates to simple text nodes or simple 
attribute nodes, but not mixed ones.

2. How do we get XSD to "play nice" with the gml: prefix? I want to use 
gml:Point and gml:pos but the XSD file doesn't validate.

Some sample XML:

<?xml version="1.0" encoding="UTF-8"?>
<user xmlns:gml="http://www.opengis.net/gml">
   <name>test</name>
    <gml:Point>
        <gml:pos dimension="2">-97.7452090, 30.2687350</gml:pos>
    </gml:Point>
</user>

The XSD file for the code (so far):

<?xml version="1.0" encoding="utf-8"?>
<xsd:schema
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:gml="http://www.opengis.net/gml">
    <xsd:import namespace="http://www.opengis.net/gml"/>
    <xsd:element name="user" type="userType" />

    <xsd:complexType name="userType">
        <xsd:sequence>
            <xsd:element name="name" type="xsd:string" />
            <xsd:element name="gml:Point" type="gml:Point" />    <---- ???
        </xsd:sequence>
    </xsd:complexType>

Thanks for your help,
René A. Enguehard





More information about the Discuss mailing list