summaryrefslogtreecommitdiff
path: root/packages/libxml
diff options
context:
space:
mode:
authorivost <ivost@3ad0048d-3df7-0310-abae-a5850022a9f2>2009-02-26 23:27:51 +0000
committerivost <ivost@3ad0048d-3df7-0310-abae-a5850022a9f2>2009-02-26 23:27:51 +0000
commit77f86c3c6b8a1e58edabafe6269985276d3f3e96 (patch)
treedda4c6fedf7c1d828b40f9b4030dc14d145fa0ad /packages/libxml
parentb44a8bcfc172af11df350e2a807cae947fed9eae (diff)
downloadfpc-77f86c3c6b8a1e58edabafe6269985276d3f3e96.tar.gz
* added new function to xmlxsd library
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@12804 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'packages/libxml')
-rw-r--r--packages/libxml/src/xmlxsd.pas19
1 files changed, 9 insertions, 10 deletions
diff --git a/packages/libxml/src/xmlxsd.pas b/packages/libxml/src/xmlxsd.pas
index 9b4b36e5b0..a2aee9b5e7 100644
--- a/packages/libxml/src/xmlxsd.pas
+++ b/packages/libxml/src/xmlxsd.pas
@@ -172,6 +172,7 @@ const
function xsdTestNode(node: xmlNodePtr; name, nameSpace: xmlCharPtr): Boolean;
function xsdTryGetChild(node: xmlNodePtr; name, nameSpace: xmlCharPtr; Index: Integer = 0): xmlNodePtr;
+function xsdTryGetChild(node: xmlNodePtr; name, nameSpace: xmlCharPtr; var child: xmlNodePtr; Index: Integer = 0): Boolean;
function xsdTryGetChildChars(node: xmlNodePtr; name, nameSpace: xmlCharPtr; Index: Integer = 0): xmlCharPtr;
function xsdTryGetChildString(node: xmlNodePtr; name, nameSpace: xmlCharPtr; var Value: String; Index: Integer = 0): Boolean;
function xsdTryGetChildBoolean(node: xmlNodePtr; name, nameSpace: xmlCharPtr; var Value: Boolean; Index: Integer = 0): Boolean;
@@ -1373,6 +1374,12 @@ begin
Result := nil;
end;
+function xsdTryGetChild(node: xmlNodePtr; name, nameSpace: xmlCharPtr; var child: xmlNodePtr; Index: Integer): Boolean;
+begin
+ child := xsdTryGetChild(node, name, nameSpace, Index);
+ Result := Assigned(child);
+end;
+
function xsdTryGetChildChars(node: xmlNodePtr; name, nameSpace: xmlCharPtr; Index: Integer): xmlCharPtr;
begin
Result := xmlNodeGetContent(xsdTryGetChild(node, name, nameSpace, Index));
@@ -1595,16 +1602,8 @@ end;
function xsdTryNext(var node: xmlNodePtr; name, nameSpace: xmlCharPtr; var last: xmlNodePtr): Boolean;
begin
- while Assigned(node) and (node^._type = XML_TEXT_NODE) do
- node := node^.next;
-
- if xsdTestNode(node, name, nameSpace) then
- begin
- last := node;
- node := node^.next;
- Result := True;
- end else
- Result := False;
+ last := xsdTryNext(node, name, nameSpace);
+ Result := Assigned(last);
end;
function xsdTryNextChars(var node: xmlNodePtr; name, nameSpace: xmlCharPtr): xmlCharPtr;