[XML Records] XML for a Rowset (used a lot in Sharepoint)

[XML Records] XML for a Rowset (used a lot in Sharepoint)

  
Forge Component
(24)
Published on 15 Jun by Ricardo Silva
24 votes
Published on 15 Jun by Ricardo Silva
Hi,

This thread answers the question at http://www.outsystems.com/NetworkForums/ViewTopic.aspx?TopicId=6151&Topic=%5b%5b%5dXML-Records%5d-Discussion#Post31147

PEDRO SOARES wrote:
Hi,

i think you can help me. I got a problema that I need to parse a xml to record list. I was reading thoose post above, but no one is like my xml instruction.
I got one like this:

		<?xml version="1.0" encoding="utf-8"?>
<xml xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882'
     xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882'
     xmlns:rs='urn:schemas-microsoft-com:rowset'
     xmlns:z='#RowsetSchema'>
  <s:Schema id='RowsetSchema'>
    <s:ElementType name='row'
                   content='eltOnly'
                   rs:CommandTimeout='30'>
      <s:AttributeType name='ows_LinkTitle'
                       rs:name='Title'
                       rs:number='2'>
        <s:datatype dt:type='string'
                    dt:maxLength='512' />
      </s:AttributeType>
      <s:AttributeType name='ows_AnnotationID'
                       rs:name='Annotation ID'
                       rs:number='3'>
        <s:datatype dt:type='string'
                    dt:maxLength='512' />
      </s:AttributeType>
      <s:AttributeType name='ows_MediaPath'
                       rs:name='Media Path'
                       rs:number='4'>
        <s:datatype dt:type='string'
                    dt:maxLength='512' />
      </s:AttributeType>
      <s:AttributeType name='ows_TimeCode'
                       rs:name='Time Code'
                       rs:number='5'>
        <s:datatype dt:type='string'
                    dt:maxLength='512' />
      </s:AttributeType>
    </s:ElementType>
  </s:Schema>
  <rs:data>
    <z:row ows_LinkTitle='my first test item'
           ows_AnnotationID='b3cd9a8c-e7d1-439e-b910-a94e1d91f406'
           ows_MediaPath='http://localhost, http://localhost/media1.wmv'
           ows_TimeCode='00:00:03.1234567' />
  </rs:data>
</xml> 
When I try to use Xml Records component, I got a msg, that unable to load the xml or the node (xml) doesn't match with the list(on this case i 've checked like 10000 times if the attributes are the same even in the list).   


Does anybody has any advice?

Thank's!!
 
 
Hi Pedro,

Try to replace in the xml text the namespaces... e.g. replace "s:" by "s", "rs:" by "rs". And afterwards name the attributes as rsname, rsCommandTimeout, etc. To parse the XML, the extension doesn't take into consideration the namespace (as it would require a lot of configurations to map Structure attributes to xml elements.
That might help
 
PEDRO SOARES wrote:
 
 I made the change that you said, but stil doesn't work.
 
 
 
Pedro,
Check in attachment an example that works for your example. You probably have something wrong in your structure or when replacing the namespaces...

 
This example is now included in the XML Records component example espace