Problem with OPENXML
- From: "Alain Quesnel" <alainsansspam@xxxxxxxxxxxx>
- Date: Wed, 6 Dec 2006 21:22:44 -0700
I'm trying to open an XML file with OPENXML. I keep getting the following
error:
The error description is 'The following tags were not closed: gpx, rte,
rtept.'
This is the full script:
DECLARE @idoc int
DECLARE @doc varchar(1000)
SET @doc =
'<?xml version="1.0"?>
<gpx version="1.1"
creator="GMapToGPX 4.13 - http://www.elsewhere.org/GMapToGPX/"
xmlns="http://www.topografix.com/GPX/1/1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.topografix.com/GPX/1/1
http://www.topografix.com/GPX/1/1/gpx.xsd">
<rte>
<name>Gmaps Pedometer Route</name>
<cmt>Permalink: <![CDATA[
Permalink temporarily unavailable.
]]>
</cmt>
<rtept lat="32.02686" lon="-111.57748">
<name>Start</name>
<ele>983.8883</ele>
</rtept>
<rtept lat="32.02384" lon="-111.577">
<name>Turn 1</name>
<ele>992.36174</ele>
</rtept>
<rtept lat="32.02074" lon="-111.57645">
<name>Turn 2</name>
<ele>1000.02746</ele>
</rtept>
<rtept lat="32.0176" lon="-111.5759">
<name>Turn 3</name>
<ele>1008.78741</ele>
</rtept>
<rtept lat="32.01447" lon="-111.57535">
<name>Turn 4</name>
<ele>1018.70256</ele>
</rtept>
</rte>
</gpx>'
--Create an internal representation of the XML document.
EXEC sp_xml_preparedocument @idoc OUTPUT, @doc
-- Execute a SELECT statement that uses the OPENXML rowset provider.
SELECT *
FROM OPENXML (@idoc, '/gpx/rte/rtept',1)
WITH (lat float,
lon float)
Thank you,
--
Alain Quesnel
alainsansspam@xxxxxxxxxxxx
www.logiquel.com
.
- Follow-Ups:
- Re: Problem with OPENXML
- From: Roger Wolter[MSFT]
- Re: Problem with OPENXML
- From: Roger Wolter[MSFT]
- Re: Problem with OPENXML
- Prev by Date: RE: Thoughts on storing address data with XML data type?
- Next by Date: Re: Problem with OPENXML
- Previous by thread: Re: pass Date varible to XPath query
- Next by thread: Re: Problem with OPENXML
- Index(es):
Relevant Pages
|