Project

Profile

Help

Revision c1cc9bd8

Added by O'Neil Delpratt 5 months ago

Saxon/C bug fix to #4848 and #4847. Also some development work

View differences:

latest10/hec/Saxon.C.API/python-saxon/test_saxonc.py
863 863
    value = xp.evaluate('//person')
864 864
    assert isinstance(value, PyXdmValue)
865 865
    assert value.size == 3
866

  
867

  
868
def test_xdm_value_iter():
869
    xml = """\
870
    <out>
871
        <person att1='value1' att2='value2'>text1</person>
872
        <person>text2</person>
873
        <person>text3</person>
874
    </out>
875
    """
876
    sp = PySaxonProcessor()
877
    xp = sp.new_xpath_processor()
878

  
879
    node = sp.parse_xml(xml_text=xml)
880
    assert isinstance(node, PyXdmNode)
881
    xp.set_context(xdm_item=node)
882
    value = xp.evaluate('//person')
883
    assert value.size == 3
884
    for item in value:
885
        assert isinstance(item, PyXdmItem)
886

  
887

  
888
def test_xdm_value_iter2():
889
    xml = """\
890
    <out>
891
        <person att1='value1' att2='value2'>text1</person>
892
        <person>text2</person>
893
        <person>text3</person>
894
    </out>
895
    """
896
    sp = PySaxonProcessor()
897
    xp = sp.new_xpath_processor()
898

  
899
    node = sp.parse_xml(xml_text=xml)
900
    assert isinstance(node, PyXdmNode)
901
    xp.set_context(xdm_item=node)
902
    value = xp.evaluate('//person')
903
    assert value.size == 3
904
    for item in value:
905
        assert 'test.' in item__str__()
906

  
866 907
    
867 908

  
868 909
def test_single():
......
894 935
    result = xpath_processor.evaluate('$s1')
895 936

  
896 937
    assert result is not None
897
    assert'test.' in result.head.string_value
938
    assert 'test.' in result.head.string_value
898 939

  
899 940

  
900 941
def test_declare_variable_value2(saxonproc):

Also available in: Unified diff