libxml-ruby 3.2.3 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/HISTORY +10 -0
- data/ext/libxml/extconf.h +3 -0
- data/ext/libxml/libxml.c +0 -1
- data/ext/libxml/libxml_ruby.def +0 -1
- data/ext/libxml/ruby_libxml.h +0 -23
- data/ext/libxml/ruby_xml.c +3 -1
- data/ext/libxml/ruby_xml.h +1 -1
- data/ext/libxml/ruby_xml_cbg.c +1 -1
- data/ext/libxml/ruby_xml_document.c +6 -0
- data/ext/libxml/ruby_xml_dtd.c +1 -1
- data/ext/libxml/ruby_xml_encoding.c +1 -1
- data/ext/libxml/ruby_xml_encoding.h +2 -0
- data/ext/libxml/ruby_xml_error.c +2 -2
- data/ext/libxml/ruby_xml_error.h +3 -1
- data/ext/libxml/ruby_xml_html_parser.c +2 -0
- data/ext/libxml/ruby_xml_html_parser_context.c +1 -0
- data/ext/libxml/ruby_xml_html_parser_options.c +2 -0
- data/ext/libxml/ruby_xml_input_cbg.c +1 -1
- data/ext/libxml/ruby_xml_io.c +1 -1
- data/ext/libxml/ruby_xml_node.c +4 -12
- data/ext/libxml/ruby_xml_parser_context.c +2 -0
- data/ext/libxml/ruby_xml_reader.c +3 -0
- data/ext/libxml/ruby_xml_reader.h +0 -3
- data/ext/libxml/ruby_xml_relaxng.c +2 -0
- data/ext/libxml/ruby_xml_relaxng.h +0 -2
- data/ext/libxml/ruby_xml_schema.c +72 -2
- data/ext/libxml/ruby_xml_schema.h +4 -785
- data/ext/libxml/ruby_xml_schema_attribute.c +46 -0
- data/ext/libxml/ruby_xml_schema_attribute.h +25 -3
- data/ext/libxml/ruby_xml_schema_element.h +0 -3
- data/ext/libxml/ruby_xml_schema_facet.c +4 -0
- data/ext/libxml/ruby_xml_schema_facet.h +0 -4
- data/ext/libxml/ruby_xml_schema_type.c +37 -0
- data/ext/libxml/ruby_xml_version.h +5 -5
- data/ext/libxml/ruby_xml_writer.c +4 -0
- data/ext/libxml/ruby_xml_writer.h +0 -4
- data/ext/libxml/ruby_xml_xinclude.c +4 -0
- data/ext/libxml/ruby_xml_xpath.c +1 -0
- data/ext/libxml/ruby_xml_xpath.h +2 -0
- data/ext/libxml/ruby_xml_xpath_context.c +2 -0
- data/ext/libxml/ruby_xml_xpath_object.c +1 -0
- data/test/test_helper.rb +4 -0
- data/test/test_xml.rb +15 -3
- metadata +4 -11
- data/MANIFEST +0 -166
- data/ext/libxml/ruby_xml_xpointer.c +0 -99
- data/ext/libxml/ruby_xml_xpointer.h +0 -11
- data/setup.rb +0 -1584
- data/test/test_suite.rb +0 -48
- data/test/test_xpointer.rb +0 -72
|
@@ -2,6 +2,52 @@
|
|
|
2
2
|
#include "ruby_xml_schema_attribute.h"
|
|
3
3
|
#include "ruby_xml_schema_type.h"
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* xmlSchemaBasicItem:
|
|
7
|
+
*
|
|
8
|
+
* The abstract base type for schema components.
|
|
9
|
+
*/
|
|
10
|
+
typedef struct _xmlSchemaBasicItem xmlSchemaBasicItem;
|
|
11
|
+
typedef xmlSchemaBasicItem *xmlSchemaBasicItemPtr;
|
|
12
|
+
struct _xmlSchemaBasicItem {
|
|
13
|
+
xmlSchemaTypeType type;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* xmlSchemaQNameRef:
|
|
18
|
+
*
|
|
19
|
+
* A component reference item (not a schema component)
|
|
20
|
+
* (Extends xmlSchemaBasicItem)
|
|
21
|
+
*/
|
|
22
|
+
typedef struct _xmlSchemaQNameRef xmlSchemaQNameRef;
|
|
23
|
+
typedef xmlSchemaQNameRef *xmlSchemaQNameRefPtr;
|
|
24
|
+
struct _xmlSchemaQNameRef {
|
|
25
|
+
xmlSchemaTypeType type;
|
|
26
|
+
xmlSchemaBasicItemPtr item;
|
|
27
|
+
/* The resolved referenced item. */
|
|
28
|
+
xmlSchemaTypeType itemType;
|
|
29
|
+
const xmlChar *name;
|
|
30
|
+
const xmlChar *targetNamespace;
|
|
31
|
+
xmlNodePtr node;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* xmlSchemaAttributeUseProhibPtr:
|
|
36
|
+
*
|
|
37
|
+
* A helper component to reflect attribute prohibitions.
|
|
38
|
+
* (Extends xmlSchemaBasicItem)
|
|
39
|
+
*/
|
|
40
|
+
typedef struct _xmlSchemaAttributeUseProhib xmlSchemaAttributeUseProhib;
|
|
41
|
+
typedef xmlSchemaAttributeUseProhib *xmlSchemaAttributeUseProhibPtr;
|
|
42
|
+
struct _xmlSchemaAttributeUseProhib {
|
|
43
|
+
xmlSchemaTypeType type;
|
|
44
|
+
/* == XML_SCHEMA_EXTRA_ATTR_USE_PROHIB */
|
|
45
|
+
xmlNodePtr node;
|
|
46
|
+
const xmlChar *name;
|
|
47
|
+
const xmlChar *targetNamespace;
|
|
48
|
+
int isRef;
|
|
49
|
+
};
|
|
50
|
+
|
|
5
51
|
VALUE cXMLSchemaAttribute;
|
|
6
52
|
|
|
7
53
|
static void rxml_schema_attribute_free(xmlSchemaAttributeUsePtr attr)
|
|
@@ -2,12 +2,34 @@
|
|
|
2
2
|
#define __RXML_SCHEMA_ATTRIBUTE__
|
|
3
3
|
|
|
4
4
|
#include "ruby_xml_schema.h"
|
|
5
|
-
#include <libxml/schemasInternals.h>
|
|
6
|
-
#include <libxml/xmlschemas.h>
|
|
7
|
-
#include <libxml/xmlschemastypes.h>
|
|
8
5
|
|
|
9
6
|
extern VALUE cXMLSchemaAttribute;
|
|
10
7
|
|
|
8
|
+
/**
|
|
9
|
+
* xmlSchemaAttributeUsePtr:
|
|
10
|
+
*
|
|
11
|
+
* The abstract base type for tree-like structured schema components.
|
|
12
|
+
* (Extends xmlSchemaTreeItem)
|
|
13
|
+
*/
|
|
14
|
+
typedef struct _xmlSchemaAttributeUse xmlSchemaAttributeUse;
|
|
15
|
+
typedef xmlSchemaAttributeUse *xmlSchemaAttributeUsePtr;
|
|
16
|
+
struct _xmlSchemaAttributeUse {
|
|
17
|
+
xmlSchemaTypeType type;
|
|
18
|
+
xmlSchemaAnnotPtr annot;
|
|
19
|
+
xmlSchemaAttributeUsePtr next; /* The next attr. use. */
|
|
20
|
+
/*
|
|
21
|
+
* The attr. decl. OR a QName-ref. to an attr. decl. OR
|
|
22
|
+
* a QName-ref. to an attribute group definition.
|
|
23
|
+
*/
|
|
24
|
+
xmlSchemaAttributePtr attrDecl;
|
|
25
|
+
|
|
26
|
+
int flags;
|
|
27
|
+
xmlNodePtr node;
|
|
28
|
+
int occurs;
|
|
29
|
+
/* required, optional */
|
|
30
|
+
const xmlChar *defValue;
|
|
31
|
+
xmlSchemaValPtr defVal;
|
|
32
|
+
};
|
|
11
33
|
|
|
12
34
|
void rxml_init_schema_attribute(void);
|
|
13
35
|
VALUE rxml_wrap_schema_attribute(xmlSchemaAttributeUsePtr attr);
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
#include "ruby_libxml.h"
|
|
2
2
|
#include "ruby_xml_schema_facet.h"
|
|
3
3
|
|
|
4
|
+
#include <libxml/schemasInternals.h>
|
|
5
|
+
#include <libxml/xmlschemas.h>
|
|
6
|
+
#include <libxml/xmlschemastypes.h>
|
|
7
|
+
|
|
4
8
|
VALUE cXMLSchemaFacet;
|
|
5
9
|
|
|
6
10
|
static void rxml_schema_facet_free(xmlSchemaFacetPtr xschema_type)
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
#ifndef __RXML_SCHEMA_FACET__
|
|
2
2
|
#define __RXML_SCHEMA_FACET__
|
|
3
3
|
|
|
4
|
-
#include <libxml/schemasInternals.h>
|
|
5
|
-
#include <libxml/xmlschemas.h>
|
|
6
|
-
#include <libxml/xmlschemastypes.h>
|
|
7
|
-
|
|
8
4
|
extern VALUE cXMLSchemaFacet;
|
|
9
5
|
|
|
10
6
|
VALUE rxml_wrap_schema_facet(xmlSchemaFacetPtr facet);
|
|
@@ -7,6 +7,43 @@
|
|
|
7
7
|
#define UNBOUNDED 1 << 30
|
|
8
8
|
#define FREE_AND_NULL(str) if ((str) != NULL) { xmlFree((xmlChar *) (str)); str = NULL; }
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* xmlSchemaTreeItem:
|
|
12
|
+
*
|
|
13
|
+
* The abstract base type for tree-like structured schema components.
|
|
14
|
+
* (Extends xmlSchemaAnnotItem)
|
|
15
|
+
*/
|
|
16
|
+
typedef struct _xmlSchemaTreeItem xmlSchemaTreeItem;
|
|
17
|
+
typedef xmlSchemaTreeItem *xmlSchemaTreeItemPtr;
|
|
18
|
+
struct _xmlSchemaTreeItem {
|
|
19
|
+
xmlSchemaTypeType type;
|
|
20
|
+
xmlSchemaAnnotPtr annot;
|
|
21
|
+
xmlSchemaTreeItemPtr next;
|
|
22
|
+
xmlSchemaTreeItemPtr children;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* xmlSchemaParticle:
|
|
27
|
+
*
|
|
28
|
+
* A particle component.
|
|
29
|
+
* (Extends xmlSchemaTreeItem)
|
|
30
|
+
*/
|
|
31
|
+
typedef struct _xmlSchemaParticle xmlSchemaParticle;
|
|
32
|
+
typedef xmlSchemaParticle *xmlSchemaParticlePtr;
|
|
33
|
+
struct _xmlSchemaParticle {
|
|
34
|
+
xmlSchemaTypeType type;
|
|
35
|
+
xmlSchemaAnnotPtr annot;
|
|
36
|
+
xmlSchemaTreeItemPtr next;
|
|
37
|
+
/* next particle */
|
|
38
|
+
xmlSchemaTreeItemPtr children;
|
|
39
|
+
/* the "term" (e.g. a model group,
|
|
40
|
+
a group definition, a XML_SCHEMA_EXTRA_QNAMEREF (if a reference),
|
|
41
|
+
etc.) */
|
|
42
|
+
int minOccurs;
|
|
43
|
+
int maxOccurs;
|
|
44
|
+
xmlNodePtr node;
|
|
45
|
+
};
|
|
46
|
+
|
|
10
47
|
VALUE cXMLSchemaType;
|
|
11
48
|
|
|
12
49
|
static void rxml_schema_type_free(xmlSchemaTypePtr xschema_type)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/* Don't nuke this block! It is used for automatically updating the
|
|
2
2
|
* versions below. VERSION = string formatting, VERNUM = numbered
|
|
3
3
|
* version for inline testing: increment both or none at all.*/
|
|
4
|
-
#define RUBY_LIBXML_VERSION "
|
|
5
|
-
#define RUBY_LIBXML_VERNUM
|
|
6
|
-
#define RUBY_LIBXML_VER_MAJ
|
|
7
|
-
#define RUBY_LIBXML_VER_MIN
|
|
8
|
-
#define RUBY_LIBXML_VER_MIC
|
|
4
|
+
#define RUBY_LIBXML_VERSION "4.0.0"
|
|
5
|
+
#define RUBY_LIBXML_VERNUM 400
|
|
6
|
+
#define RUBY_LIBXML_VER_MAJ 4
|
|
7
|
+
#define RUBY_LIBXML_VER_MIN 0
|
|
8
|
+
#define RUBY_LIBXML_VER_MIC 0
|
|
9
9
|
#define RUBY_LIBXML_VER_PATCH 0
|
data/ext/libxml/ruby_xml_xpath.c
CHANGED
data/ext/libxml/ruby_xml_xpath.h
CHANGED
data/test/test_helper.rb
CHANGED
data/test/test_xml.rb
CHANGED
|
@@ -167,11 +167,19 @@ class TestXml < Minitest::Test
|
|
|
167
167
|
end
|
|
168
168
|
|
|
169
169
|
def test_enabled_docbook
|
|
170
|
-
|
|
170
|
+
if windows?
|
|
171
|
+
refute(LibXML::XML.enabled_docbook?)
|
|
172
|
+
else
|
|
173
|
+
assert(LibXML::XML.enabled_docbook?)
|
|
174
|
+
end
|
|
171
175
|
end
|
|
172
176
|
|
|
173
177
|
def test_enabled_ftp
|
|
174
|
-
|
|
178
|
+
if windows?
|
|
179
|
+
refute(LibXML::XML.enabled_ftp?)
|
|
180
|
+
else
|
|
181
|
+
assert(LibXML::XML.enabled_ftp?)
|
|
182
|
+
end
|
|
175
183
|
end
|
|
176
184
|
|
|
177
185
|
def test_enabled_http
|
|
@@ -242,7 +250,11 @@ class TestXml < Minitest::Test
|
|
|
242
250
|
end
|
|
243
251
|
|
|
244
252
|
def test_libxml_parser_features
|
|
245
|
-
|
|
253
|
+
if windows?
|
|
254
|
+
assert_nil(LibXML::XML.features)
|
|
255
|
+
else
|
|
256
|
+
assert_instance_of(Array, LibXML::XML.features)
|
|
257
|
+
end
|
|
246
258
|
end
|
|
247
259
|
|
|
248
260
|
def test_default_options
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: libxml-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 4.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ross Bamform
|
|
@@ -14,7 +14,7 @@ authors:
|
|
|
14
14
|
autorequire:
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
|
-
date: 2022-
|
|
17
|
+
date: 2022-12-28 00:00:00.000000000 Z
|
|
18
18
|
dependencies:
|
|
19
19
|
- !ruby/object:Gem::Dependency
|
|
20
20
|
name: rake-compiler
|
|
@@ -58,9 +58,9 @@ extra_rdoc_files: []
|
|
|
58
58
|
files:
|
|
59
59
|
- HISTORY
|
|
60
60
|
- LICENSE
|
|
61
|
-
- MANIFEST
|
|
62
61
|
- README.rdoc
|
|
63
62
|
- Rakefile
|
|
63
|
+
- ext/libxml/extconf.h
|
|
64
64
|
- ext/libxml/extconf.rb
|
|
65
65
|
- ext/libxml/libxml.c
|
|
66
66
|
- ext/libxml/libxml_ruby.def
|
|
@@ -135,8 +135,6 @@ files:
|
|
|
135
135
|
- ext/libxml/ruby_xml_xpath_expression.h
|
|
136
136
|
- ext/libxml/ruby_xml_xpath_object.c
|
|
137
137
|
- ext/libxml/ruby_xml_xpath_object.h
|
|
138
|
-
- ext/libxml/ruby_xml_xpointer.c
|
|
139
|
-
- ext/libxml/ruby_xml_xpointer.h
|
|
140
138
|
- ext/vc/libxml_ruby.sln
|
|
141
139
|
- lib/libxml-ruby.rb
|
|
142
140
|
- lib/libxml.rb
|
|
@@ -167,7 +165,6 @@ files:
|
|
|
167
165
|
- script/benchmark/sock_entries.xml
|
|
168
166
|
- script/benchmark/throughput
|
|
169
167
|
- script/test
|
|
170
|
-
- setup.rb
|
|
171
168
|
- test/c14n/given/doc.dtd
|
|
172
169
|
- test/c14n/given/example-1.xml
|
|
173
170
|
- test/c14n/given/example-2.xml
|
|
@@ -251,7 +248,6 @@ files:
|
|
|
251
248
|
- test/test_relaxng.rb
|
|
252
249
|
- test/test_sax_parser.rb
|
|
253
250
|
- test/test_schema.rb
|
|
254
|
-
- test/test_suite.rb
|
|
255
251
|
- test/test_traversal.rb
|
|
256
252
|
- test/test_writer.rb
|
|
257
253
|
- test/test_xinclude.rb
|
|
@@ -259,7 +255,6 @@ files:
|
|
|
259
255
|
- test/test_xpath.rb
|
|
260
256
|
- test/test_xpath_context.rb
|
|
261
257
|
- test/test_xpath_expression.rb
|
|
262
|
-
- test/test_xpointer.rb
|
|
263
258
|
homepage: https://xml4r.github.io/libxml-ruby/
|
|
264
259
|
licenses:
|
|
265
260
|
- MIT
|
|
@@ -279,7 +274,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
279
274
|
- !ruby/object:Gem::Version
|
|
280
275
|
version: '0'
|
|
281
276
|
requirements: []
|
|
282
|
-
rubygems_version: 3.3.
|
|
277
|
+
rubygems_version: 3.3.26
|
|
283
278
|
signing_key:
|
|
284
279
|
specification_version: 4
|
|
285
280
|
summary: Ruby Bindings for LibXML2
|
|
@@ -316,7 +311,6 @@ test_files:
|
|
|
316
311
|
- test/test_relaxng.rb
|
|
317
312
|
- test/test_sax_parser.rb
|
|
318
313
|
- test/test_schema.rb
|
|
319
|
-
- test/test_suite.rb
|
|
320
314
|
- test/test_traversal.rb
|
|
321
315
|
- test/test_writer.rb
|
|
322
316
|
- test/test_xinclude.rb
|
|
@@ -324,4 +318,3 @@ test_files:
|
|
|
324
318
|
- test/test_xpath.rb
|
|
325
319
|
- test/test_xpath_context.rb
|
|
326
320
|
- test/test_xpath_expression.rb
|
|
327
|
-
- test/test_xpointer.rb
|
data/MANIFEST
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
#!mast -x doc/libxml-ruby/rdoc -i .gitignore ext doc lib script test [A-Z]*
|
|
2
|
-
ext/libxml/extconf.rb
|
|
3
|
-
ext/libxml/libxml.c
|
|
4
|
-
ext/libxml/ruby_libxml.h
|
|
5
|
-
ext/libxml/ruby_xml.c
|
|
6
|
-
ext/libxml/ruby_xml.h
|
|
7
|
-
ext/libxml/ruby_xml_attr.c
|
|
8
|
-
ext/libxml/ruby_xml_attr.h
|
|
9
|
-
ext/libxml/ruby_xml_attr_decl.c
|
|
10
|
-
ext/libxml/ruby_xml_attr_decl.h
|
|
11
|
-
ext/libxml/ruby_xml_attributes.c
|
|
12
|
-
ext/libxml/ruby_xml_attributes.h
|
|
13
|
-
ext/libxml/ruby_xml_cbg.c
|
|
14
|
-
ext/libxml/ruby_xml_document.c
|
|
15
|
-
ext/libxml/ruby_xml_document.h
|
|
16
|
-
ext/libxml/ruby_xml_dtd.c
|
|
17
|
-
ext/libxml/ruby_xml_dtd.h
|
|
18
|
-
ext/libxml/ruby_xml_encoding.c
|
|
19
|
-
ext/libxml/ruby_xml_encoding.h
|
|
20
|
-
ext/libxml/ruby_xml_error.c
|
|
21
|
-
ext/libxml/ruby_xml_error.h
|
|
22
|
-
ext/libxml/ruby_xml_html_parser.c
|
|
23
|
-
ext/libxml/ruby_xml_html_parser.h
|
|
24
|
-
ext/libxml/ruby_xml_html_parser_context.c
|
|
25
|
-
ext/libxml/ruby_xml_html_parser_context.h
|
|
26
|
-
ext/libxml/ruby_xml_html_parser_options.c
|
|
27
|
-
ext/libxml/ruby_xml_html_parser_options.h
|
|
28
|
-
ext/libxml/ruby_xml_input_cbg.c
|
|
29
|
-
ext/libxml/ruby_xml_input_cbg.h
|
|
30
|
-
ext/libxml/ruby_xml_io.c
|
|
31
|
-
ext/libxml/ruby_xml_io.h
|
|
32
|
-
ext/libxml/ruby_xml_namespace.c
|
|
33
|
-
ext/libxml/ruby_xml_namespace.h
|
|
34
|
-
ext/libxml/ruby_xml_namespaces.c
|
|
35
|
-
ext/libxml/ruby_xml_namespaces.h
|
|
36
|
-
ext/libxml/ruby_xml_node.c
|
|
37
|
-
ext/libxml/ruby_xml_node.h
|
|
38
|
-
ext/libxml/ruby_xml_parser.c
|
|
39
|
-
ext/libxml/ruby_xml_parser.h
|
|
40
|
-
ext/libxml/ruby_xml_parser_context.c
|
|
41
|
-
ext/libxml/ruby_xml_parser_context.h
|
|
42
|
-
ext/libxml/ruby_xml_parser_options.c
|
|
43
|
-
ext/libxml/ruby_xml_parser_options.h
|
|
44
|
-
ext/libxml/ruby_xml_reader.c
|
|
45
|
-
ext/libxml/ruby_xml_reader.h
|
|
46
|
-
ext/libxml/ruby_xml_relaxng.c
|
|
47
|
-
ext/libxml/ruby_xml_relaxng.h
|
|
48
|
-
ext/libxml/ruby_xml_sax2_handler.c
|
|
49
|
-
ext/libxml/ruby_xml_sax2_handler.h
|
|
50
|
-
ext/libxml/ruby_xml_sax_parser.c
|
|
51
|
-
ext/libxml/ruby_xml_sax_parser.h
|
|
52
|
-
ext/libxml/ruby_xml_schema.c
|
|
53
|
-
ext/libxml/ruby_xml_schema.h
|
|
54
|
-
ext/libxml/ruby_xml_version.h
|
|
55
|
-
ext/libxml/ruby_xml_xinclude.c
|
|
56
|
-
ext/libxml/ruby_xml_xinclude.h
|
|
57
|
-
ext/libxml/ruby_xml_xpath.c
|
|
58
|
-
ext/libxml/ruby_xml_xpath.h
|
|
59
|
-
ext/libxml/ruby_xml_xpath_context.c
|
|
60
|
-
ext/libxml/ruby_xml_xpath_context.h
|
|
61
|
-
ext/libxml/ruby_xml_xpath_expression.c
|
|
62
|
-
ext/libxml/ruby_xml_xpath_expression.h
|
|
63
|
-
ext/libxml/ruby_xml_xpath_object.c
|
|
64
|
-
ext/libxml/ruby_xml_xpath_object.h
|
|
65
|
-
ext/libxml/ruby_xml_xpointer.c
|
|
66
|
-
ext/libxml/ruby_xml_xpointer.h
|
|
67
|
-
ext/mingw/Rakefile
|
|
68
|
-
ext/mingw/build.rake
|
|
69
|
-
ext/mingw/libiconv-2.dll
|
|
70
|
-
ext/mingw/libxml2-2.dll
|
|
71
|
-
ext/mingw/libxml_ruby.dll.a
|
|
72
|
-
ext/mingw/libxml_ruby.so
|
|
73
|
-
ext/vc/libxml_ruby.sln
|
|
74
|
-
ext/vc/libxml_ruby_18/libxml_ruby.vcproj
|
|
75
|
-
ext/vc/libxml_ruby_19/libxml_ruby_19.vcproj
|
|
76
|
-
doc/.htaccess
|
|
77
|
-
doc/.rsync-filter
|
|
78
|
-
lib/libxml/attr.rb
|
|
79
|
-
lib/libxml/attr_decl.rb
|
|
80
|
-
lib/libxml/attributes.rb
|
|
81
|
-
lib/libxml/document.rb
|
|
82
|
-
lib/libxml/error.rb
|
|
83
|
-
lib/libxml/hpricot.rb
|
|
84
|
-
lib/libxml/html_parser.rb
|
|
85
|
-
lib/libxml/namespace.rb
|
|
86
|
-
lib/libxml/namespaces.rb
|
|
87
|
-
lib/libxml/node.rb
|
|
88
|
-
lib/libxml/ns.rb
|
|
89
|
-
lib/libxml/parser.rb
|
|
90
|
-
lib/libxml/properties.rb
|
|
91
|
-
lib/libxml/reader.rb
|
|
92
|
-
lib/libxml/sax_callbacks.rb
|
|
93
|
-
lib/libxml/sax_parser.rb
|
|
94
|
-
lib/libxml/tree.rb
|
|
95
|
-
lib/libxml/xpath_object.rb
|
|
96
|
-
lib/libxml.rb
|
|
97
|
-
lib/xml/libxml.rb
|
|
98
|
-
lib/xml.rb
|
|
99
|
-
script/benchmark/depixelate
|
|
100
|
-
script/benchmark/hamlet.xml
|
|
101
|
-
script/benchmark/parsecount
|
|
102
|
-
script/benchmark/sock_entries.xml
|
|
103
|
-
script/benchmark/throughput
|
|
104
|
-
script/test
|
|
105
|
-
test/etc_doc_to_s.rb
|
|
106
|
-
test/ets_doc_file.rb
|
|
107
|
-
test/ets_doc_to_s.rb
|
|
108
|
-
test/ets_gpx.rb
|
|
109
|
-
test/ets_node_gc.rb
|
|
110
|
-
test/ets_test.xml
|
|
111
|
-
test/ets_tsr.rb
|
|
112
|
-
test/model/atom.xml
|
|
113
|
-
test/model/bands.xml
|
|
114
|
-
test/model/books.xml
|
|
115
|
-
test/model/merge_bug_data.xml
|
|
116
|
-
test/model/ruby-lang.html
|
|
117
|
-
test/model/rubynet.xml
|
|
118
|
-
test/model/rubynet_project
|
|
119
|
-
test/model/shiporder.rnc
|
|
120
|
-
test/model/shiporder.rng
|
|
121
|
-
test/model/shiporder.xml
|
|
122
|
-
test/model/shiporder.xsd
|
|
123
|
-
test/model/soap.xml
|
|
124
|
-
test/model/xinclude.xml
|
|
125
|
-
test/test_attr.rb
|
|
126
|
-
test/test_attr_decl.rb
|
|
127
|
-
test/test_attributes.rb
|
|
128
|
-
test/test_deprecated_require.rb
|
|
129
|
-
test/test_document.rb
|
|
130
|
-
test/test_document_write.rb
|
|
131
|
-
test/test_dtd.rb
|
|
132
|
-
test/test_error.rb
|
|
133
|
-
test/test_html_parser.rb
|
|
134
|
-
test/test_namespace.rb
|
|
135
|
-
test/test_namespaces.rb
|
|
136
|
-
test/test_node.rb
|
|
137
|
-
test/test_node_cdata.rb
|
|
138
|
-
test/test_node_comment.rb
|
|
139
|
-
test/test_node_copy.rb
|
|
140
|
-
test/test_node_edit.rb
|
|
141
|
-
test/test_node_pi.rb
|
|
142
|
-
test/test_node_text.rb
|
|
143
|
-
test/test_node_write.rb
|
|
144
|
-
test/test_node_xlink.rb
|
|
145
|
-
test/test_parser.rb
|
|
146
|
-
test/test_parser_context.rb
|
|
147
|
-
test/test_properties.rb
|
|
148
|
-
test/test_reader.rb
|
|
149
|
-
test/test_relaxng.rb
|
|
150
|
-
test/test_sax_parser.rb
|
|
151
|
-
test/test_schema.rb
|
|
152
|
-
test/test_traversal.rb
|
|
153
|
-
test/test_xinclude.rb
|
|
154
|
-
test/test_xml.rb
|
|
155
|
-
test/test_xpath.rb
|
|
156
|
-
test/test_xpath_context.rb
|
|
157
|
-
test/test_xpath_expression.rb
|
|
158
|
-
test/test_xpointer.rb
|
|
159
|
-
test/test_suite.rb
|
|
160
|
-
Rakefile
|
|
161
|
-
HISTORY.rdoc
|
|
162
|
-
PROFILE
|
|
163
|
-
TODO
|
|
164
|
-
LICENSE
|
|
165
|
-
README.rdoc
|
|
166
|
-
VERSION
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/* Please see the LICENSE file for copyright and distribution information */
|
|
2
|
-
|
|
3
|
-
#include "ruby_libxml.h"
|
|
4
|
-
#include "ruby_xml_xpointer.h"
|
|
5
|
-
|
|
6
|
-
VALUE cXMLXPointer;
|
|
7
|
-
|
|
8
|
-
/*
|
|
9
|
-
* Document-class: LibXML::XML::XPointer
|
|
10
|
-
*
|
|
11
|
-
* The XML::Pointer class provides a standards based API for searching an xml document.
|
|
12
|
-
* XPointer is based on the XML Path Language (XML::XPath) and is documented
|
|
13
|
-
* at http://www.w3.org/TR/WD-xptr.
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
static VALUE rxml_xpointer_point(VALUE class, VALUE rnode, VALUE xptr_str)
|
|
17
|
-
{
|
|
18
|
-
#ifdef LIBXML_XPTR_ENABLED
|
|
19
|
-
xmlNodePtr xnode;
|
|
20
|
-
xmlXPathContextPtr xctxt;
|
|
21
|
-
xmlXPathObjectPtr xpop;
|
|
22
|
-
|
|
23
|
-
VALUE context;
|
|
24
|
-
VALUE result;
|
|
25
|
-
VALUE argv[1];
|
|
26
|
-
|
|
27
|
-
Check_Type(xptr_str, T_STRING);
|
|
28
|
-
if (rb_obj_is_kind_of(rnode, cXMLNode) == Qfalse)
|
|
29
|
-
rb_raise(rb_eTypeError, "require an XML::Node object");
|
|
30
|
-
|
|
31
|
-
Data_Get_Struct(rnode, xmlNode, xnode);
|
|
32
|
-
|
|
33
|
-
argv[0] = rb_funcall(rnode, rb_intern("doc"), 0);
|
|
34
|
-
context = rb_class_new_instance(1, argv, cXMLXPathContext);
|
|
35
|
-
Data_Get_Struct(context, xmlXPathContext, xctxt);
|
|
36
|
-
|
|
37
|
-
xpop = xmlXPtrEval((xmlChar*)StringValuePtr(xptr_str), xctxt);
|
|
38
|
-
if (!xpop)
|
|
39
|
-
rxml_raise(&xmlLastError);
|
|
40
|
-
|
|
41
|
-
result = rxml_xpath_object_wrap(xnode->doc, xpop);
|
|
42
|
-
rb_iv_set(result, "@context", context);
|
|
43
|
-
|
|
44
|
-
return(result);
|
|
45
|
-
#else
|
|
46
|
-
rb_warn("libxml was compiled without XPointer support");
|
|
47
|
-
return (Qfalse);
|
|
48
|
-
#endif
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
VALUE rxml_xpointer_point2(VALUE node, VALUE xptr_str)
|
|
52
|
-
{
|
|
53
|
-
return (rxml_xpointer_point(cXMLXPointer, node, xptr_str));
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/*
|
|
57
|
-
* call-seq:
|
|
58
|
-
* XML::XPointer.range(start_node, end_node) -> xpath
|
|
59
|
-
*
|
|
60
|
-
* Create an xpath representing the range between the supplied
|
|
61
|
-
* start and end node.
|
|
62
|
-
*/
|
|
63
|
-
static VALUE rxml_xpointer_range(VALUE class, VALUE rstart, VALUE rend)
|
|
64
|
-
{
|
|
65
|
-
#ifdef LIBXML_XPTR_ENABLED
|
|
66
|
-
xmlNodePtr start, end;
|
|
67
|
-
VALUE rxxp;
|
|
68
|
-
xmlXPathObjectPtr xpath;
|
|
69
|
-
|
|
70
|
-
if (rb_obj_is_kind_of(rstart, cXMLNode) == Qfalse)
|
|
71
|
-
rb_raise(rb_eTypeError, "require an XML::Node object as a starting point");
|
|
72
|
-
if (rb_obj_is_kind_of(rend, cXMLNode) == Qfalse)
|
|
73
|
-
rb_raise(rb_eTypeError, "require an XML::Node object as an ending point");
|
|
74
|
-
|
|
75
|
-
Data_Get_Struct(rstart, xmlNode, start);
|
|
76
|
-
if (start == NULL)
|
|
77
|
-
return(Qnil);
|
|
78
|
-
|
|
79
|
-
Data_Get_Struct(rend, xmlNode, end);
|
|
80
|
-
if (end == NULL)
|
|
81
|
-
return(Qnil);
|
|
82
|
-
|
|
83
|
-
xpath = xmlXPtrNewRangeNodes(start, end);
|
|
84
|
-
if (xpath == NULL)
|
|
85
|
-
rb_fatal("You shouldn't be able to have this happen");
|
|
86
|
-
|
|
87
|
-
rxxp = rxml_xpath_object_wrap(start->doc, xpath);
|
|
88
|
-
return(rxxp);
|
|
89
|
-
#else
|
|
90
|
-
rb_warn("libxml was compiled without XPointer support");
|
|
91
|
-
return (Qfalse);
|
|
92
|
-
#endif
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
void rxml_init_xpointer(void)
|
|
96
|
-
{
|
|
97
|
-
cXMLXPointer = rb_define_class_under(mXML, "XPointer", rb_cObject);
|
|
98
|
-
rb_define_singleton_method(cXMLXPointer, "range", rxml_xpointer_range, 2);
|
|
99
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/* Please see the LICENSE file for copyright and distribution information */
|
|
2
|
-
|
|
3
|
-
#ifndef __RXML_XPOINTER__
|
|
4
|
-
#define __RXML_XPOINTER__
|
|
5
|
-
|
|
6
|
-
extern VALUE cXMLXPointer;
|
|
7
|
-
|
|
8
|
-
void rxml_init_xpointer(void);
|
|
9
|
-
VALUE rxml_xpointer_point2(VALUE node, VALUE xptr_str);
|
|
10
|
-
|
|
11
|
-
#endif
|