+
    xȇi7                    .   ^ RI Ht ^ RIHtHt ^ RIt^ RIt^ RIt^ RI	H
u Ht ^ RIHtHtHt ^ RIHt ^ RIHt ^ RIHt ]P0                  R 4       t]P0                  R 4       t]P0                  R	 4       tR
 t]P0                  ! RR.R7      R 4       t]P0                  ! ]P<                  ! R]P>                  ! R4      R7      R.R7      R 4       t R t!R t"R t#R t$R t%R t&]PN                  PQ                  R])]*.4      R 4       t+Rt,R t-R t.R t/R t0R  t1R! t2R" t3R# t4R$ t5R% t6R& t7R' t8R( t9R) t:R* t;R+ t<R, t=R- t>R. t?R/ t@R0tAR1 tBR2 tC]PN                  PQ                  R3. RPO4      R4 4       tDR5 tER6 tFR7 tGR8 tH]P                  ! R4      R9 4       tJR: tKR;tLR< tMR= tNR> tOR? tP]PN                  PQ                  R@]! RA4      ]! RB4      .4      RC 4       tQRD tRRE tSRF tTRG tURH tVRI tWRJ tXRtYRK tZRL t[RM t\RN t]]PN                  P                  RO 4       t_R# )Q    )annotations)BytesIOStringION)NA	DataFrameIndex)
get_handle)read_xmlc            
     N    \        R . ROR. ROR^\        P                  ^./4      # )shapedegreessides)squarecircletriangle)h  r      )r   npnan     o/Users/max/.openclaw/workspace/postharvest/venv/lib/python3.14/site-packages/pandas/tests/io/xml/test_to_xml.pygeom_dfr   ;   s.    5a^	
 r   c                 8    \        R . ROR. ROR. ROR. RO/4      # )planettypelocationmass)MercuryVenusEarthMarsJupiterSaturnUranusNeptune)terrestrialr'   r'   r'   	gas giantr(   	ice giantr)   )innerr*   r*   r*   outerr+   r+   r+   )g`|x ?gcAJx@g2r@gl?gh|@g	@gd]FU@g	hY@)r   r   r   r   	planet_dfr,   F   s:     	  	  	  	?)	
+ +r   c                     R # )ac  <?xml version='1.0' encoding='utf-8'?>
<data>
  <row>
    <index>0</index>
    <category>cooking</category>
    <title>Everyday Italian</title>
    <author>Giada De Laurentiis</author>
    <year>2005</year>
    <price>30.0</price>
  </row>
  <row>
    <index>1</index>
    <category>children</category>
    <title>Harry Potter</title>
    <author>J K. Rowling</author>
    <year>2005</year>
    <price>29.99</price>
  </row>
  <row>
    <index>2</index>
    <category>web</category>
    <title>Learning XML</title>
    <author>Erik T. Ray</author>
    <year>2003</year>
    <price>39.95</price>
  </row>
</data>r   r   r   r   from_file_expectedr.   v   s    r   c                2    V e   V P                  RR4      p V # )Nz%<?xml version="1.0" encoding="utf-8"?z%<?xml version='1.0' encoding='utf-8'?)replace)docs   &r   equalize_declr2      s"    
kk33
 Jr   rbr)paramsc                    V P                   # Nparamrequests   &r   moder<          ==r   lxml)marksetreec                    V P                   # r7   r8   r:   s   &r   parserrB      r=   r   c                    \        WR 7      pVP                  W1R 7       VP                  RR7      P                  4       p\	        V4      pWR8X  g   Q hR# rB   utf-8encodingNr
   to_xml	read_textstripr2   	xml_booksrB   r.   	temp_filedf_fileoutputs   &&&&  r   test_file_output_str_readrR      L    y0GNN9N,  ' 288:F6"F'''r   c                    \        WR 7      pVP                  W1R 7       VP                  RR7      P                  4       p\	        V4      pWR8X  g   Q hR# rD   rI   rM   s   &&&&  r   test_file_output_bytes_readrU      rS   r   c                h    \        WR 7      pVP                  VR 7      p\        V4      pWB8X  g   Q hR# rE   N)r
   rJ   r2   )rN   rB   r.   rP   rQ   s   &&&  r   test_str_outputrX      s2    y0G^^6^*F6"F'''r   c                    R p\         P                  ! \        RR7      ;_uu_ 4        VP                  W R7       RRR4       R#   + '       g   i     R# ; i)z/my/fake/path/output.xmlz6Cannot save file into a non-existent directory: .*pathmatchrE   N)pytestraisesOSErrorrJ   )rB   r   paths   && r   test_wrong_file_pathr`      sC    %D	H
 
 	t+	
 
 
 
s   AA	c                    R p\        WR7      pVP                  VRVR7       VP                  RR7      P                  4       p\	        V4      pWS8X  g   Q hR# )a$  <?xml version='1.0' encoding='utf-8'?>
<data>
  <row>
    <category>cooking</category>
    <title>Everyday Italian</title>
    <author>Giada De Laurentiis</author>
    <year>2005</year>
    <price>30.0</price>
  </row>
  <row>
    <category>children</category>
    <title>Harry Potter</title>
    <author>J K. Rowling</author>
    <year>2005</year>
    <price>29.99</price>
  </row>
  <row>
    <category>web</category>
    <title>Learning XML</title>
    <author>Erik T. Ray</author>
    <year>2003</year>
    <price>39.95</price>
  </row>
</data>rE   FindexrB   rF   rG   NrI   rN   rB   rO   expectedrP   rQ   s   &&&   r   test_index_falserf      sY    H4 y0GNN9E&N9  ' 288:F6"Fr   c                    R p\        WR7      pVP                  VRRRVR7       VP                  RR7      P                  4       p\	        V4      pWS8X  g   Q hR# )	a,  <?xml version='1.0' encoding='utf-8'?>
<books>
  <book>
    <category>cooking</category>
    <title>Everyday Italian</title>
    <author>Giada De Laurentiis</author>
    <year>2005</year>
    <price>30.0</price>
  </book>
  <book>
    <category>children</category>
    <title>Harry Potter</title>
    <author>J K. Rowling</author>
    <year>2005</year>
    <price>29.99</price>
  </book>
  <book>
    <category>web</category>
    <title>Learning XML</title>
    <author>Erik T. Ray</author>
    <year>2003</year>
    <price>39.95</price>
  </book>
</books>rE   Fbooksbook)rc   	root_namerow_namerB   rF   rG   NrI   rd   s   &&&   r    test_index_false_rename_row_rootrl      se    H4 y0GNN'F6     ' 288:F6"Fr   typc                    Rp\        ^
^4       Uu. uF
  qA! V4      NK  	  ppVP                  4       p\        V4      Vn        VP	                  RV R7      p\        V4      pWs8X  g   Q hR# u upi )z
Tests that the output does not contain the `<index>` field when the index of the
input Dataframe has an offset.

This is a regression test for issue #42458.
aD  <?xml version='1.0' encoding='utf-8'?>
<data>
  <row>
    <shape>square</shape>
    <degrees>360</degrees>
    <sides>4.0</sides>
  </row>
  <row>
    <shape>circle</shape>
    <degrees>360</degrees>
    <sides/>
  </row>
  <row>
    <shape>triangle</shape>
    <degrees>180</degrees>
    <sides>3.0</sides>
  </row>
</data>Frb   N)rangecopyr   rc   rJ   r2   )rB   rm   r   re   ioffset_indexoffset_geom_dfrQ   s   &&&     r   (test_index_false_with_offset_input_indexrt   %  sq    H& %*"bM2MqCFML2\\^N .N""v">F6"F 3s   A+a  <?xml version='1.0' encoding='utf-8'?>
<data>
  <row>
    <index>0</index>
    <shape>square</shape>
    <degrees>360</degrees>
    <sides>4.0</sides>
  </row>
  <row>
    <index>1</index>
    <shape>circle</shape>
    <degrees>360</degrees>
    <sides/>
  </row>
  <row>
    <index>2</index>
    <shape>triangle</shape>
    <degrees>180</degrees>
    <sides>3.0</sides>
  </row>
</data>c                Z    VP                  V R 7      p\        V4      pV\        8X  g   Q hR# rW   rJ   r2   na_expectedrB   r   rQ   s   && r   test_na_elem_outputry   d  s*    ^^6^*F6"F[   r   c                \    VP                  R V R7      p\        V4      pV\        8X  g   Q hR# ) na_reprB   Nrv   rx   s   && r   test_na_empty_str_elem_optionr~   k  s,    ^^2f^5F6"F[   r   c                V    R pVP                  RV R7      p\        V4      pW28X  g   Q hR# )a  <?xml version='1.0' encoding='utf-8'?>
<data>
  <row>
    <index>0</index>
    <shape>square</shape>
    <degrees>360</degrees>
    <sides>4.0</sides>
  </row>
  <row>
    <index>1</index>
    <shape>circle</shape>
    <degrees>360</degrees>
    <sides>0.0</sides>
  </row>
  <row>
    <index>2</index>
    <shape>triangle</shape>
    <degrees>180</degrees>
    <sides>3.0</sides>
  </row>
</data>z0.0r|   NrJ   r2   rB   r   re   rQ   s   &&  r   test_na_empty_elem_optionr   r  s3    H. ^^5^8F6"Fr   c                Z    R pVP                  . ROV R7      p\        V4      pW28X  g   Q hR# )z<?xml version='1.0' encoding='utf-8'?>
<data>
  <row index="0" shape="square" degrees="360" sides="4.0"/>
  <row index="1" shape="circle" degrees="360"/>
  <row index="2" shape="triangle" degrees="180" sides="3.0"/>
</data>	attr_colsrB   N)r   r   r   r   r   s   &&  r   test_attrs_cols_nan_outputr     s4    H ^^&CF^SF6"Fr   c                b    R pVP                  . RORR/RV R7      p\        V4      pW28X  g   Q hR# )a>  <?xml version='1.0' encoding='utf-8'?>
<doc:data xmlns:doc="http://example.xom">
  <doc:row doc:index="0" doc:shape="square" doc:degrees="360" doc:sides="4.0"/>
  <doc:row doc:index="1" doc:shape="circle" doc:degrees="360"/>
  <doc:row doc:index="2" doc:shape="triangle" doc:degrees="180" doc:sides="3.0"/>
</doc:data>r1   zhttp://example.xom)r   
namespacesprefixrB   N)rc   r   r   r   r   r   s   &&  r   test_attrs_cols_prefixr     sH    	H ^^8/0	  F 6"Fr   c                    \         P                  ! \        R R7      ;_uu_ 4        VP                  . ROV R7       RRR4       R#   + '       g   i     R# ; i)no valid columnrZ   r   Nr   degreer   r\   r]   KeyErrorrJ   rB   r   s   &&r   test_attrs_unknown_columnr     4    	x(9	;	;!=fM 
<	;	;	;   AA	c                    \         P                  ! \        R R7      ;_uu_ 4        VP                  RV R7       RRR4       R#   + '       g   i     R# ; i)z!is not a valid type for attr_colsrZ   "shape", "degree", "sides"r   Nr\   r]   	TypeErrorrJ   r   s   &&r   test_attrs_wrong_typer     5    	y)L	N	N!=fM 
O	N	N	N   AA	c                \    R pVP                  R. ROV R7      p\        V4      pW28X  g   Q hR# )aD  <?xml version='1.0' encoding='utf-8'?>
<data>
  <row>
    <degrees>360</degrees>
    <sides>4.0</sides>
    <shape>square</shape>
  </row>
  <row>
    <degrees>360</degrees>
    <sides/>
    <shape>circle</shape>
  </row>
  <row>
    <degrees>180</degrees>
    <sides>3.0</sides>
    <shape>triangle</shape>
  </row>
</data>F)rc   	elem_colsrB   N)r   r   r   r   rB   r   elems_cols_expectedrQ   s   &&  r   test_elems_cols_nan_outputr     s?    ( ^^<V  F 6"F(((r   c                    \         P                  ! \        R R7      ;_uu_ 4        VP                  . ROV R7       RRR4       R#   + '       g   i     R# ; i)r   rZ   r   rB   Nr   r   r   s   &&r   test_elems_unknown_columnr     r   r   c                    \         P                  ! \        R R7      ;_uu_ 4        VP                  RV R7       RRR4       R#   + '       g   i     R# ; i)z!is not a valid type for elem_colsrZ   r   r   Nr   r   s   &&r   test_elems_wrong_typer     r   r   c                `    R pVP                  RRR.R.V R7      p\        V4      pW28X  g   Q hR# )a#  <?xml version='1.0' encoding='utf-8'?>
<data>
  <row shape="square">
    <degrees>360</degrees>
    <sides>4.0</sides>
  </row>
  <row shape="circle">
    <degrees>360</degrees>
    <sides/>
  </row>
  <row shape="triangle">
    <degrees>180</degrees>
    <sides>3.0</sides>
  </row>
</data>Fr   r   r   )rc   r   r   rB   Nr   r   s   &&  r   test_elems_and_attrs_colsr     sJ    " ^^g&)	  F 6"F(((r   c                    R pVP                  RR.R. RORR7      P                  ^4      pVP                  V R7      p\        V4      pWB8X  g   Q hR# )	a  <?xml version='1.0' encoding='utf-8'?>
<data>
  <row>
    <location>inner</location>
    <type>terrestrial</type>
    <count_mass>4</count_mass>
    <sum_mass>11.81</sum_mass>
    <mean_mass>2.95</mean_mass>
  </row>
  <row>
    <location>outer</location>
    <type>gas giant</type>
    <count_mass>2</count_mass>
    <sum_mass>2466.5</sum_mass>
    <mean_mass>1233.25</mean_mass>
  </row>
  <row>
    <location>outer</location>
    <type>ice giant</type>
    <count_mass>2</count_mass>
    <sum_mass>189.23</sum_mass>
    <mean_mass>94.61</mean_mass>
  </row>
  <row>
    <location>All</location>
    <type/>
    <count_mass>8</count_mass>
    <sum_mass>2667.54</sum_mass>
    <mean_mass>333.44</mean_mass>
  </row>
</data>r   r   r   Trc   valuesaggfuncmarginsrE   Ncountsummean)pivot_tableroundrJ   r2   rB   r,   re   pvtrQ   s   &&   r   test_hierarchical_columnsr     sh    HB 

6"(	   
 eAh  ZZvZ&F6"Fr   c                    R pVP                  RR.R. RORR7      P                  ^4      pVP                  \        VP	                  4       P
                  P                  4      V R7      p\        V4      pWB8X  g   Q hR# )	a  <?xml version='1.0' encoding='utf-8'?>
<data>
  <row location="inner" type="terrestrial" count_mass="4" sum_mass="11.81" mean_mass="2.95"/>
  <row location="outer" type="gas giant" count_mass="2" sum_mass="2466.5" mean_mass="1233.25"/>
  <row location="outer" type="ice giant" count_mass="2" sum_mass="189.23" mean_mass="94.61"/>
  <row location="All" type="" count_mass="8" sum_mass="2667.54" mean_mass="333.44"/>
</data>r   r   r   Tr   r   Nr   )r   r   rJ   listreset_indexcolumnsr   r2   r   s   &&   r   test_hierarchical_attrs_columnsr   <  s    H 

6"(	   
 eAh  ZZ$s'8'@'@'G'G"HQWZXF6"Fr   c                    R pVP                  RR.4      R,          P                  . RO4      P                  ^4      pVP                  V R7      p\	        V4      pWB8X  g   Q hR# )a  <?xml version='1.0' encoding='utf-8'?>
<data>
  <row>
    <location>inner</location>
    <type>terrestrial</type>
    <count>4</count>
    <sum>11.81</sum>
    <mean>2.95</mean>
  </row>
  <row>
    <location>outer</location>
    <type>gas giant</type>
    <count>2</count>
    <sum>2466.5</sum>
    <mean>1233.25</mean>
  </row>
  <row>
    <location>outer</location>
    <type>ice giant</type>
    <count>2</count>
    <sum>189.23</sum>
    <mean>94.61</mean>
  </row>
</data>r   r   r   rE   Nr   )groupbyaggr   rJ   r2   rB   r,   re   r   rQ   s   &&   r   test_multi_indexr   Z  sd    H6 	:v./7	%	&	q  ZZvZ&F6"Fr   c                    R pVP                  RR.4      R,          P                  . RO4      P                  ^4      pVP                  \	        VP                  4       P                  P                  4      V R7      p\        V4      pWB8X  g   Q hR# )a$  <?xml version='1.0' encoding='utf-8'?>
<data>
  <row location="inner" type="terrestrial" count="4" sum="11.81" mean="2.95"/>
  <row location="outer" type="gas giant" count="2" sum="2466.5" mean="1233.25"/>
  <row location="outer" type="ice giant" count="2" sum="189.23" mean="94.61"/>
</data>r   r   r   r   Nr   )	r   r   r   rJ   r   r   r   r   r2   r   s   &&   r   test_multi_index_attrs_colsr     s    	H 	:v./7	%	&	q 
 ZZ$s'8'@'@'G'G"HQWZXF6"Fr   c                Z    R pVP                  RR/V R7      p\        V4      pW28X  g   Q hR# )a  <?xml version='1.0' encoding='utf-8'?>
<data xmlns="http://example.com">
  <row>
    <index>0</index>
    <shape>square</shape>
    <degrees>360</degrees>
    <sides>4.0</sides>
  </row>
  <row>
    <index>1</index>
    <shape>circle</shape>
    <degrees>360</degrees>
    <sides/>
  </row>
  <row>
    <index>2</index>
    <shape>triangle</shape>
    <degrees>180</degrees>
    <sides>3.0</sides>
  </row>
</data>r{   http://example.comr   rB   Nr   r   s   &&  r   test_default_namespacer     s9    H. ^^,@'A&^QF6"Fr   c                ^    R pVP                  RRRR/V R7      p\        V4      pW28X  g   Q hR# )a  <?xml version='1.0' encoding='utf-8'?>
<data xmlns:oth="http://other.org" xmlns:ex="http://example.com">
  <row>
    <index>0</index>
    <shape>square</shape>
    <degrees>360</degrees>
    <sides>4.0</sides>
  </row>
  <row>
    <index>1</index>
    <shape>circle</shape>
    <degrees>360</degrees>
    <sides/>
  </row>
  <row>
    <index>2</index>
    <shape>triangle</shape>
    <degrees>180</degrees>
    <sides>3.0</sides>
  </row>
</data>othhttp://other.orgexr   r   Nr   r   s   &&  r   test_unused_namespacesr     sG    H. ^^-t5IJ  F 6"Fr   c                \    R pVP                  RR/RV R7      p\        V4      pW28X  g   Q hR# )a  <?xml version='1.0' encoding='utf-8'?>
<doc:data xmlns:doc="http://example.com">
  <doc:row>
    <doc:index>0</doc:index>
    <doc:shape>square</doc:shape>
    <doc:degrees>360</doc:degrees>
    <doc:sides>4.0</doc:sides>
  </doc:row>
  <doc:row>
    <doc:index>1</doc:index>
    <doc:shape>circle</doc:shape>
    <doc:degrees>360</doc:degrees>
    <doc:sides/>
  </doc:row>
  <doc:row>
    <doc:index>2</doc:index>
    <doc:shape>triangle</doc:shape>
    <doc:degrees>180</doc:degrees>
    <doc:sides>3.0</doc:sides>
  </doc:row>
</doc:data>r1   r   r   r   rB   Nr   r   s   &&  r   test_namespace_prefixr     sC    H. ^^/0v  F 6"Fr   c                    \         P                  ! \        R R7      ;_uu_ 4        VP                  RR/RV R7       RRR4       R#   + '       g   i     R# ; i)z!doc is not included in namespacesrZ   r{   r   r1   r   Nr   r   s   &&r   test_missing_prefix_in_nmspr     sB    	x(K	M	M01% 	 	
 
N	M	M	Ms   AA	c                `    R pVP                  RRRR/RV R7      p\        V4      pW28X  g   Q hR# )a7  <?xml version='1.0' encoding='utf-8'?>
<doc:data xmlns:doc="http://other.org" xmlns="http://example.com">
  <doc:row>
    <doc:index>0</doc:index>
    <doc:shape>square</doc:shape>
    <doc:degrees>360</doc:degrees>
    <doc:sides>4.0</doc:sides>
  </doc:row>
  <doc:row>
    <doc:index>1</doc:index>
    <doc:shape>circle</doc:shape>
    <doc:degrees>360</doc:degrees>
    <doc:sides/>
  </doc:row>
  <doc:row>
    <doc:index>2</doc:index>
    <doc:shape>triangle</doc:shape>
    <doc:degrees>180</doc:degrees>
    <doc:sides>3.0</doc:sides>
  </doc:row>
</doc:data>r{   r   r1   r   r   Nr   r   s   &&  r   !test_namespace_prefix_and_defaultr     sJ    H. ^^,e5GH  F
 6"Fr   u  <?xml version='1.0' encoding='ISO-8859-1'?>
<data>
  <row>
    <index>0</index>
    <rank>1</rank>
    <malename>José</malename>
    <femalename>Sofía</femalename>
  </row>
  <row>
    <index>1</index>
    <rank>2</rank>
    <malename>Luis</malename>
    <femalename>Valentina</femalename>
  </row>
  <row>
    <index>2</index>
    <rank>3</rank>
    <malename>Carlos</malename>
    <femalename>Isabella</femalename>
  </row>
  <row>
    <index>3</index>
    <rank>4</rank>
    <malename>Juan</malename>
    <femalename>Camila</femalename>
  </row>
  <row>
    <index>4</index>
    <rank>5</rank>
    <malename>Jorge</malename>
    <femalename>Valeria</femalename>
  </row>
</data>c                    \        WR R7      P                  ^4      pVP                  R VR7      pVe   VP                  RR4      pV\        8X  g   Q hR# )
ISO-8859-1)rB   rH   rH   rB   Nz*<?xml version="1.0" encoding="ISO-8859-1"?z*<?xml version='1.0' encoding='ISO-8859-1'?)r
   headrJ   r0   encoding_expected)xml_baby_namesrB   rP   rQ   s   &&  r   test_encoding_option_strr   L  sW    ~|LQQRSTG^^\&^AF88

 &&&&r   c                x    \         P                  ! R 4       \        V RR R7      pVP                  VRRR R7       R# r>   r   r   F)rc   rH   rB   Nr\   importorskipr
   rJ   )r   rO   rP   s   && r   test_correct_encoding_filer   [  s2    
~VLGNN9ELNPr   rH   c                v    \         P                  ! R 4       \        V RR R7      pVP                  VRW!R7       R# r   r   )r   rB   rH   rO   rP   s   &&&& r   test_wrong_encoding_option_lxmlr   b  s0    
~VLGNN9EHNLr   c                    \         P                  ! \        R R7      ;_uu_ 4        VP                  RV R7       RRR4       R#   + '       g   i     R# ; i)zunknown encodingrZ   zuft-8r   N)r\   r]   LookupErrorrJ   r   s   &&r   test_misspelled_encodingr   j  s4    	{+=	?	?7 
@	?	?	?r   c                j    \         P                  ! R 4       RpV P                  RR7      pW!8X  g   Q hR# )r>   a\  <data>
  <row>
    <index>0</index>
    <shape>square</shape>
    <degrees>360</degrees>
    <sides>4.0</sides>
  </row>
  <row>
    <index>1</index>
    <shape>circle</shape>
    <degrees>360</degrees>
    <sides/>
  </row>
  <row>
    <index>2</index>
    <shape>triangle</shape>
    <degrees>180</degrees>
    <sides>3.0</sides>
  </row>
</data>F)xml_declarationN)r\   r   rJ   )r   re   rQ   s   &  r   !test_xml_declaration_pretty_printr   r  s5    
H, ^^E^2Fr   c                    R pVP                  RV R7      p\        V4      pVe   VP                  RR4      pW28X  g   Q hR# )a4  <?xml version='1.0' encoding='utf-8'?>
<data><row><index>0</index><shape>square</shape><degrees>360</degrees><sides>4.0</sides></row><row><index>1</index><shape>circle</shape><degrees>360</degrees><sides/></row><row><index>2</index><shape>triangle</shape><degrees>180</degrees><sides>3.0</sides></row></data>F)pretty_printrB   N />/>)rJ   r2   r0   r   s   &&  r   test_no_pretty_print_with_declr     sN    	  ^^v^>F6"F t,r   c                n    R pVP                  RRV R7      pVe   VP                  RR4      pW28X  g   Q hR# )a  <data><row><index>0</index><shape>square</shape><degrees>360</degrees><sides>4.0</sides></row><row><index>1</index><shape>circle</shape><degrees>360</degrees><sides/></row><row><index>2</index><shape>triangle</shape><degrees>180</degrees><sides>3.0</sides></row></data>F)r   r   rB   Nr   r   )rJ   r0   r   s   &&  r   test_no_pretty_print_no_declr     sF    	  ^^Ef^UF t,r   c                    \         P                  ! \        R R7      ;_uu_ 4        V P                  4        RRR4       R#   + '       g   i     R# ; i)z7lxml not found, please install or use the etree parser.rZ   N)r\   r]   ImportErrorrJ   r   s   &r   test_default_parser_no_lxmlr     s:    	U
 
 	
 
 
 
s   A  A	c                    \         P                  ! \        R R7      ;_uu_ 4        V P                  RR7       RRR4       R#   + '       g   i     R# ; i)z,Values for parser can only be lxml or etree.rZ   bs4rE   Nr\   r]   
ValueErrorrJ   r   s   &r   test_unknown_parserr     s>    	I
 
 	e$
 
 
 
s   AA	a%  <?xml version="1.0" encoding="utf-8"?>
<data>
  <row>
    <field field="index">0</field>
    <field field="shape">square</field>
    <field field="degrees">360</field>
    <field field="sides">4.0</field>
  </row>
  <row>
    <field field="index">1</field>
    <field field="shape">circle</field>
    <field field="degrees">360</field>
    <field field="sides"/>
  </row>
  <row>
    <field field="index">2</field>
    <field field="shape">triangle</field>
    <field field="degrees">180</field>
    <field field="sides">3.0</field>
  </row>
</data>c                    \         P                  ! R 4       \        YVR8X  d   RMRR7      ;_uu_ 4       pVP                  VR7      \        8X  g   Q h RRR4       R#   + '       g   i     R# ; ir>   r4   rF   NrG   
stylesheetr\   r   openrJ   xsl_expected)xsl_row_field_outputr<   r   fs   &&& r   test_stylesheet_file_liker     s[    
	W
 
	
~~~+|;;;
 
 
 
s   AA/	c                X   \         P                  ! R 4       \        YVR8X  d   RMRR7      ;_uu_ 4       pVR8X  d   \        VP	                  4       4      pM\        VP	                  4       4      pRRR4       VP                  XR7      pV\        8X  g   Q hR#   + '       g   i     L1; i)r>   r4   rF   NrG   r3   r   )r\   r   r   r   readr   rJ   r   )r   r<   r   r   xsl_objrQ   s   &&&   r   test_stylesheet_ior    s      
W
 
	
4<affh'Gqvvx(G
 ^^w^/F\!!!
 
s   ;BB)	c                    \         P                  ! R 4       \        YVR8X  d   RMRR7      ;_uu_ 4       pVP                  VR7      pRRR4       X\        8X  g   Q hR#   + '       g   i     L; ir   r   )r   r<   r   r   rQ   s   &&&  r   test_stylesheet_buffered_readerr    s]    
	W
 
	
1-

 \!!!
 
s   AA/	c                   \         P                  ! R 4       \        P                  P	                  RRRR4      p\         P
                  ! \        RR7      ;_uu_ 4        V P                  VR7       RRR4       R#   + '       g   i     R# ; i)	
lxml.etreedoesnotexistzrow_field_output.xsltz$\[Errno 2\] No such file or directorrZ   r   N)r\   r   osr_   joinr]   FileNotFoundErrorrJ   r   xsls   & r   test_stylesheet_wrong_pathr    se    
%
'',,vug/F
GC	!H
 
 	#&
 
 
 
s   A::B	valr{   r   c                
   \         P                  ! R 4      pRP                  . RO4      p\         P                  ! VP                  VR7      ;_uu_ 4        VP                  V R7       RRR4       R#   + '       g   i     R# ; i)r  |rZ   r   N)zDocument is emptyz!Start tag expected, '<' not foundzNone \(line 0\))r\   r   r  r]   XMLSyntaxErrorrJ   )r  r   
lxml_etreemsgs   &&  r   test_empty_string_stylesheetr    s[    $$\2J
((	
C 
z00	<	<#& 
=	<	<	<s   A11B	c                    \         P                  ! R 4      pRp\         P                  ! VP                  RR7      ;_uu_ 4        V P	                  \        V4      R7       RRR4       R#   + '       g   i     R# ; i)r  aR  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" encoding="utf-8" indent="yes" >
    <xsl:strip-space elements="*"/>

    <xsl:template match="@*|node()">
        <xsl:copy>
            <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
    </xsl:template>

    <xsl:template match="row/*">
        <field>
            <xsl:attribute name="field">
                <xsl:value-of select="name()"/>
            </xsl:attribute>
            <xsl:value-of select="text()"/>
        </field>
    </xsl:template>
</xsl:stylesheet>zOpening and ending tag mismatchrZ   r   N)r\   r   r]   r  rJ   r   r   r  r  s   &  r   test_incorrect_xsl_syntaxr  $  sa    $$\2JC* 
!!)J
 
 	(3-0
 
 
 
   A))A:	c                    \         P                  ! R 4      pRp\         P                  ! VP                  RR7      ;_uu_ 4        V P	                  \        V4      R7       RRR4       R#   + '       g   i     R# ; i)r  aT  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" encoding="utf-8" indent="yes" />
    <xsl:strip-space elements="*"/>

    <xsl:template match="@*|node(*)">
        <xsl:copy>
            <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
    </xsl:template>

    <xsl:template match="row/*">
        <field>
            <xsl:attribute name="field">
                <xsl:value-of select="name()"/>
            </xsl:attribute>
            <xsl:value-of select="text()"/>
        </field>
    </xsl:template>
</xsl:stylesheet>zfailed to compilerZ   r   N)r\   r   r]   XSLTParseErrorrJ   r   r  s   &  r   test_incorrect_xsl_evalr  B  sU    $$\2JC* 
z008K	L	L(3-0 
M	L	L	Lr  c                    \         P                  ! R 4      pRp\         P                  ! VP                  RR7      ;_uu_ 4        V P	                  V\        V4      R7       RRR4       R#   + '       g   i     R# ; i)r  ag  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" encoding="utf-8" indent="yes" />
    <xsl:strip-space elements="*"/>

    <xsl:template match="@*|node()">
        <xsl:copy>
            <xsl:copy-of select="document('non_existent.xml')/*"/>
        </xsl:copy>
    </xsl:template>
</xsl:stylesheet>zCannot resolve URIrZ   r   N)r\   r   r]   XSLTApplyErrorrJ   r   )r   rO   r  r  s   &&  r   test_incorrect_xsl_applyr!  ^  sW    $$\2J
C 
z008L	M	MyXc]; 
N	M	M	Ms   A**A;	c                    R p\         P                  ! \        RR7      ;_uu_ 4        V P                  R\	        V4      R7       RRR4       R#   + '       g   i     R# ; i)aI  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" encoding="utf-8" indent="yes" />
    <xsl:strip-space elements="*"/>

    <xsl:template match="@*|node(*)">
        <xsl:copy>
            <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
    </xsl:template>z*To use stylesheet, you need lxml installedrZ   r@   )rB   r   N)r\   r]   r   rJ   r   r  s   & r   test_stylesheet_with_etreer#  q  sA    	C 
z)U	V	Vg(3-@ 
W	V	V	Vs   AA	c                    \         P                  ! R 4       RpV P                  RR7      pVe   VP                  4       pV P	                  \        V4      R7      pW#8X  g   Q hR# )r>   aQ  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="text" indent="yes" />
    <xsl:strip-space elements="*"/>

    <xsl:param name="delim">,</xsl:param>
    <xsl:template match="/data">
        <xsl:text>,shape,degrees,sides&#xa;</xsl:text>
        <xsl:apply-templates select="row"/>
    </xsl:template>

    <xsl:template match="row">
        <xsl:value-of select="concat(index, $delim, shape, $delim,
                                     degrees, $delim, sides)"/>
         <xsl:text>&#xa;</xsl:text>
    </xsl:template>
</xsl:stylesheet>
)lineterminatorNr   )r\   r   to_csvrL   rJ   r   )r   r  out_csvout_xmls   &   r   test_style_to_csvr*    sZ    
C$ nnDn1G--/nnn6Gr   c                    \         P                  ! R 4       RpV P                  4       pV P                  R\	        V4      R7      pW28X  g   Q hR# )r>   a  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="text" indent="yes" />
    <xsl:strip-space elements="*"/>

    <xsl:param name="delim"><xsl:text>               </xsl:text></xsl:param>
    <xsl:template match="/data">
        <xsl:text>      shape  degrees  sides&#xa;</xsl:text>
        <xsl:apply-templates select="row"/>
    </xsl:template>

    <xsl:template match="row">
        <xsl:value-of select="concat(index, ' ',
                                     substring($delim, 1, string-length('triangle')
                                               - string-length(shape) + 1),
                                     shape,
                                     substring($delim, 1, string-length(name(degrees))
                                               - string-length(degrees) + 2),
                                     degrees,
                                     substring($delim, 1, string-length(name(sides))
                                               - string-length(sides) + 2),
                                     sides)"/>
         <xsl:text>&#xa;</xsl:text>
    </xsl:template>
</xsl:stylesheet>NaN)r}   r   N)r\   r   	to_stringrJ   r   )r   r  out_strr)  s   &   r   test_style_to_stringr/    sI    
C4 !GnnEhsmnDGr   c                    \         P                  ! R 4       RpV P                  4       pV P                  \	        V4      R7      pW#8X  g   Q hR# )r>   a]  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="text" indent="yes" />
    <xsl:strip-space elements="*"/>

    <xsl:param name="quot">"</xsl:param>

    <xsl:template match="/data">
        <xsl:text>{"shape":{</xsl:text>
        <xsl:apply-templates select="descendant::row/shape"/>
        <xsl:text>},"degrees":{</xsl:text>
        <xsl:apply-templates select="descendant::row/degrees"/>
        <xsl:text>},"sides":{</xsl:text>
        <xsl:apply-templates select="descendant::row/sides"/>
        <xsl:text>}}</xsl:text>
    </xsl:template>

    <xsl:template match="shape|degrees|sides">
        <xsl:variable name="val">
            <xsl:if test = ".=''">
                <xsl:value-of select="'null'"/>
            </xsl:if>
            <xsl:if test = "number(text()) = text()">
                <xsl:value-of select="text()"/>
            </xsl:if>
            <xsl:if test = "number(text()) != text()">
                <xsl:value-of select="concat($quot, text(), $quot)"/>
            </xsl:if>
        </xsl:variable>
        <xsl:value-of select="concat($quot, preceding-sibling::index,
                                     $quot,':', $val)"/>
        <xsl:if test="preceding-sibling::index != //row[last()]/index">
            <xsl:text>,</xsl:text>
        </xsl:if>
    </xsl:template>
</xsl:stylesheet>r   N)r\   r   to_jsonrJ   r   )r   r  out_jsonr)  s   &   r   test_style_to_jsonr3    sF    
#CJ  Hnnn6Gr   c                   TpVP                  W@VR 7       \        VRVR7      ;_uu_ 4       pVP                  P                  4       pRRR4       \	        X4      p\
        VP                  4       8X  g   Q hR#   + '       g   i     L8; i)rB   compressionr4   r6  NrJ   r	   handler  r2   geom_xmlrL   )rB   compression_onlyr   rO   r_   
handle_objrQ   s   &&&&   r   test_compression_outputr=    sw    DNN44DNE	$
 
 
""'')
 6"Fv||~%%%
 
s   A77B	c                >   R W1,          ,           pWE,          pVP                  W`VR7       \        VRVR7      ;_uu_ 4       pVP                  P                  4       pRRR4       \	        X4      p\
        VP                  4       8X  g   Q hR#   + '       g   i     L8; i)zxml.r5  r4   r7  Nr8  )	rB   r;  r   compression_to_extensiontmp_pathcompfiler_   r<  rQ   s	   &&&&&    r   test_filename_and_suffix_comprB    s     0BBHDNN44DNE	$
 
 
""'')
 6"Fv||~%%%
 
s   BB	c                    R p\        R\        ./4      P                  V 4      pVP                  VR7      p\	        V4      P                  4       V8X  g   Q hR# )zd<?xml version='1.0' encoding='utf-8'?>
<data>
  <row>
    <index>0</index>
    <a/>
  </row>
</data>arE   N)r   r   astyperJ   r2   rL   )any_numeric_ea_dtyperB   re   dfresults   &&   r   test_ea_dtypesrI  +  sS    H 
C";		&	&';	<BYYfY%F &&(H444r   c                    \         P                  ! \        R R7      ;_uu_ 4        TpVP                  W0RR7       RRR4       R#   + '       g   i     R# ; i)zUnrecognized compression typerZ   7zr5  Nr   )rB   r   rO   r_   s   &&& r   test_unsupported_compressionrL  9  s9    	z)H	I	It= 
J	I	I	Ir   c                   \         P                  ! R 4      p\         P                  ! R4       \        P                  ! \        \
        34      ;_uu_ 4        VP                  RR7      pVP                  VP                  4       VP                  RVP                   R2RV R7       RRR4       R#   + '       g   i     R# ; i)	s3fsr>   T)anonzs3://z	/geom.xmlzip)r6  rB   N)
r\   r   tmexternal_error_raisedPermissionErrorr  S3FileSystemlsnamerJ   )rB   s3_bucket_publicr   rN  fss   &&&  r   test_s3_permission_outputrY  B  s    v&D
		!	!?4E"F	G	GD)
##$$))*)4%PV 	 	
	 
H	G	G	Gs   AB//C 	)zUTF-8zUTF-16r   )`
__future__r   ior   r   r  numpyr   r\   pandas.util._test_decoratorsutil_test_decoratorstdpandasr   r   r   pandas._testing_testingrQ  pandas.io.commonr	   pandas.io.xmlr
   fixturer   r,   r.   r2   r<   r9   
skip_if_norB   rR   rU   rX   r`   rf   rl   markparametrizeintstrrt   rw   ry   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   skip_if_installedr   r   r   r   r  r  r  r  r  r  r!  r#  r*  r/  r3  r:  r=  rB  rI  rL  
single_cpurY  r   r   r   <module>rn     s   " 
   ) ) 
  ' "J   , ,^  > c{# $ V2==3HI7ST U(((,"J$N c
+! ,!L0!!B.N
N):N
N
)@,^<$N4<H@
H! H'Q %FGM HM8:*, f %0<"&"' "ws| <=' >' 1<18<&A :D*`0& &&5> 

 

r   