Home All Groups Group Topic Archive Search About

OPENXML - element has _xpath in name

Author
28 Jul 2005 6:46 PM
A Lowly Tech
With this sample, OPENXML returns null for the element named cont_exec_xpath,
but change the name of that element to anything else that does not have
_xpath in the name, and it returns the data.
Any ideas?
DECLARE @sampleXML varchar(8000)
SET @sampleXML = N'<ROOT><T1Link_Message_Step_list_Tbl>
                        <optional_execution>5</optional_execution>
                        <message_id>99912345</message_id>
                        <step_id>20120</step_id>
                        <dependent_seq_id_list>0</dependent_seq_id_list>
                        <omit_response>1</omit_response>
                        <cont_exec_path>3333</cont_exec_path>
                        <multi_step>0</multi_step>
                        <sequence_order>5</sequence_order>
                        </T1Link_Message_Step_list_Tbl>
                        </ROOT>'
DECLARE @hDoc int
EXEC sp_xml_preparedocument @hDoc OUTPUT, @sampleXML
SELECT *
FROM   OPENXML (@hDoc, N'/ROOT/T1Link_Message_Step_list_Tbl',2)
WITH 
(
    [message_id] [int]  ,
    [step_id] [int]  ,
    [sequence_order] [varchar] (50)  ,
    [multi_step] [int]  ,
    [omit_response] [varchar] (1),
    [cont_exec_path] [varchar] (255),
    [dependent_seq_id_list] [varchar] (30) ,
    [UpdateDtm] [datetime]  ,
    [optional_execution] [char] (1) ,
    [UpdatedBy] [varchar] (50)  ,
    [DBCL_ID] [uniqueidentifier]  )

Author
28 Jul 2005 7:35 PM
Anith Sen
You may want to post this to public.sqlserver.xml forum.

I am not familiar with this issue, could be a bug, esp. since it seems like
any element with "_x" will cause the resulting value to be NULL.

--
Anith

AddThis Social Bookmark Button