[ 
https://issues.apache.org/jira/browse/PIG-4762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15070790#comment-15070790
 ] 

Eyal Allweil commented on PIG-4762:
-----------------------------------

On Pig 12 and 14, the first XML seems to be loaded fine for me. Were you using 
a different version?

> XMLLoader issue when the parent and child tags starts with the same name(See 
> Description).
> ------------------------------------------------------------------------------------------
>
>                 Key: PIG-4762
>                 URL: https://issues.apache.org/jira/browse/PIG-4762
>             Project: Pig
>          Issue Type: Bug
>          Components: piggybank
>            Reporter: Shylesh Monica
>
> I'm having issues with loading the XML using Piggybank's XMLLoader. 
> The XML does not load correctly when the XML has a child element starting 
> with the same name as the parent (See the Person tag and Person_ID tag).
> <Person>
>       <FirstName>John</FirstName>
>       <MiddleName/> 
>       <LastName>Lennon</LastName>
>       <Person_ID>JL</Person_ID>
>       <Address>       
>               <Street1>1 New Street</Street1>
>               <Street2/>
>               <City>New town</City>
>               <State>New State</State>
>               <Zip>00001</Zip>
>       </Address>
> </Person>
> A = LOAD 'test.xml'  USING org.apache.pig.piggybank.storage.XMLLoader 
> ('Person') AS(x:chararray);
> DUMP a;
> OUTPUT
>  (<Person_ID/>)
> However the XML loads correctly when the child tag doesn't start with the 
> parent tag's name
> <Person>
>       <FirstName>John</FirstName>
>       <MiddleName/> 
>       <LastName>Lennon</LastName>
>       <ID_Person>JL</ID_Person>
>       <Address>       
>               <Street1>1 New Street</Street1>
>               <Street2/>
>               <City>New town</City>
>               <State>New State</State>
>               <Zip>00001</Zip>
>       </Address>
> </Person>
> A = LOAD 'test.xml'  USING org.apache.pig.piggybank.storage.XMLLoader 
> ('Person') AS(x:chararray);
> DUMP a;
>  OUTPUT
>  
> (<Person>       <FirstName>John</FirstName>     <MiddleName/>   
> <LastName>Lennon</LastName>     <ID_Person>JL<ID_Person/>       <Address>     
>                   <Street1>1 New Street</Street1>             <Street2/>      
>         <City>New town</City>           <State>New State</State>              
>   <Zip>00001</Zip>        </Address>      </Person>)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to