When i read xml data as objects (dot notation), the properties of the objects are all [string] while the proper data types are in the <schema> part of the xml document.
sample file:
<doc>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="doc">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="item">
<xs:complexType>
<xs:sequence>
<xs:element name="astring" type="xs:string" minOccurs="0"/>
<xs:element name="along" type="xs:long" minOccurs="0"/>
<xs:element name="adate" type="xs:dateTime" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<item>
<astring>qwerty</astring>
<along>12345</along>
<adate>2017-06-09T13:18:30</adate>
</item>
</doc>
When i do:
PS>[xml]$xml=get-content("d:\temp\sample.xml")
PS>$xml.doc.item|get-member
it shows:
adate Property
string adate {get;set;}
along Property
string along {get;set;}
astring Property string astring {get;set;}
Is this normal or am i doing something wrong?
Maybe the question is too simple but i couldn't find an answer in the forum archive.
Thx,
Roel