You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openoffice.apache.org by bu...@apache.org on 2011/10/15 14:53:15 UTC
DO NOT REPLY [Bug 118514] Faulty method getElementsByTagName with
com.sun.star.xml.dom.XElement resp. XDocument
https://issues.apache.org/ooo/show_bug.cgi?id=118514
--- Comment #1 from Volker Lenhardt <vo...@uni-due.de> 2011-10-15 12:53:15 UTC ---
Sorry, copying the the test code from my module I mixed up important lines. The
code has to be changed to become meaningful:
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
For i = 0 To 10 'With "slot" and "validTo" even 10000 is ok
oElements = oDOM.getElementsByTagName(sTagName)
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
--
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.