incubator-ooo-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 118514] New: Faulty method getElementsByTagName with com.sun.star.xml.dom.XElement resp. XDocument
Date Sat, 15 Oct 2011 12:37:53 GMT
https://issues.apache.org/ooo/show_bug.cgi?id=118514

             Bug #: 118514
        Issue Type: DEFECT
           Summary: Faulty method getElementsByTagName with
                    com.sun.star.xml.dom.XElement resp. XDocument
    Classification: Code
           Product: xml
           Version: OOo 3.2.1
          Platform: PC
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: major
          Priority: P5
         Component: code
        AssignedTo: mib@openoffice.org
        ReportedBy: volker.lenhardt@uni-due.de
                CC: ooo-issues@incubator.apache.org


Created attachment 76891
  --> https://issues.apache.org/ooo/attachment.cgi?id=76891
Fancy xml file as test object for the getElementsByTagName bug

Importing xml files with DOM. The getElementsByTagName method of the interfaces
com.sun.star.xml.dom.XDocument and com.sun.star.xml.dom.XDocument yields faulty
results for tag names of length 8 and 16 (no longer names tested).

Usually the bug doesn't show with only few elements. You can force the bug to
become visible by multiple calls to the test below or by increasing the number
of iterations. OOo gets unstable and is apt to crash.

I attach a short fancy xml file. You can use this test on the file.

Sub Test
  Dim sURL As String
  Dim oDocBuilder
  Dim oDOM
  Dim i%
  Dim oElements
  Dim sTagName As String

  sTagName = "validTo" 'Length 7: okay -> 10 elements
  'sTagName = "document" 'Length 8: faulty -> 10 elements
  'sTagName = "slot" 'Length 4: okay -> 13 elements
  'sTagName = "customer" 'Length 8: faulty -> 18 elements
  sURL = "your_path"
  oDocBuilder = createUnoService("com.sun.star.xml.dom.DocumentBuilder")
  oDOM = oDocBuilder.parseURI(sUrl)
  oDOM.normalize()
  If IsEmpty(oDOM) Then Exit Sub
    oElements = oDOM.getElementsByTagName(sTagName)
'    Print oElements.getLength
'    Exit Sub
  For i = 0 To 10         'With "slot" and "validTo" even 10000 is ok
    If oElements.getLength <> 10 Then  'Number depends on the tag name (s.a.)
        Print i, "Error"
        Exit Sub
    End If
  Next
  Print "Done"
End Sub

Volker Lenhardt

-- 
Configure bugmail: https://issues.apache.org/ooo/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

Mime
View raw message