XMLSequence SQL Example–Part 1

We are starting a new series of blog post, that will explain the usage of XMLSequence with a complex XML. Refer to the XML provided below

<Product type="Laptop">
            <Notebook Brand="HP" Model="Pavilion dv6-3132TX Notebook">
                        <Harddisk>640 GB</Harddisk>
                        <Processor>Intel Core i7</Processor>
                        <RAM>4 GB</RAM>
                        <Price>1189</Price>
                        <Display Type="LED" MonitorSize="15.6"/>
                        <Weight>4.14</Weight>
            </Notebook>
            <Notebook Brand="HP" Model="HP Pavilion dv6-3032TX Notebook">
                        <Harddisk>640 GB</Harddisk>
                        <Processor>Intel Core i7</Processor>
                        <RAM>6 GB</RAM>
                        <Price>1104</Price>
                        <Display Type="LED" MonitorSize="15.6"/>
                        <Weight>4.1</Weight>
            </Notebook>
            <Notebook Brand="HP" Model="Pavilion dv6-3079TX Notebook">
                        <Harddisk>500 GB</Harddisk>
                        <Processor>Intel Core i7</Processor>
                        <RAM>4 GB</RAM>
                        <Price>1099</Price>
                        <Display Type="LED" MonitorSize="15.6"/>
                        <Weight>4.14</Weight>
            </Notebook>
            <Notebook Brand="Toshiba" Model="Satellite A660/07R 3D Notebook">
                        <Harddisk>640 GB</Harddisk>
                        <Processor>Intel Core i7</Processor>
                        <RAM>4 GB</RAM>
                        <Price>1444</Price>
                        <Display Type="LED" MonitorSize="15.6"/>
                        <Weight>4.88</Weight>
            </Notebook>
            <Notebook Brand="Toshiba" Model="Satellite A660/15J Notebook">
                        <Harddisk>640 GB</Harddisk>
                        <Processor>Intel Core i5</Processor>
                        <RAM>6 GB</RAM>
                        <Price>1399</Price>
                        <Display Type="LED" MonitorSize="15.6"/>
                        <Weight>3.9</Weight>
            </Notebook>
</Product>

The output of our SQL should be something on the lines provided below:
Brand Model Hard Disk Processor RAM Price DisplayType Weight Monitor Size
HP Pavilion dv6-3132TX Notebook  640 GB intel Core i7 4 GB 1189 LED 4.14 15.6
HP HP Pavilion dv6-3032TX Notebook  640 GB Intel Core i7 6 GB 1104 LED 4.1 15.6
HP Pavilion dv6-3079TX Notebook 500 GB Intel Core i7 4 GB 1099 LED 4.14 15.6
Toshiba Satellite A660/07R 3D Notebook 640 GB Intel Core i7 4 GB 1444 LED 4.88 15.6
Toshiba Satellite A660/15J Notebook 640 GB Intel Core i5 6 GB 1399 LED 3.9 15.6

Refer to our previous posts in the related post section below on how to get started with this..In the meantime, we will post a detailed explanation to achieve our objective using XMLSequence.

No comments:

Post a Comment