incubator-ooo-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 118514] New: Faulty method getElementsByTagName with resp. XDocument
Date Sat, 15 Oct 2011 12:37:53 GMT

             Bug #: 118514
        Issue Type: DEFECT
           Summary: Faulty method getElementsByTagName with
           resp. XDocument
    Classification: Code
           Product: xml
           Version: OOo 3.2.1
          Platform: PC
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: major
          Priority: P5
         Component: code

Created attachment 76891
Fancy xml file as test object for the getElementsByTagName bug

Importing xml files with DOM. The getElementsByTagName method of the interfaces and 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("")
  oDOM = oDocBuilder.parseURI(sUrl)
  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
  Print "Done"
End Sub

Volker Lenhardt

Configure bugmail:
------- You are receiving this mail because: -------
You are on the CC list for the bug.

View raw message