nokogiri 1.12.3-x86-mingw32 → 1.12.4-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of nokogiri might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/ext/nokogiri/include/libxslt/xsltconfig.h +1 -1
- data/ext/nokogiri/xml_node.c +7 -0
- data/lib/nokogiri/2.5/nokogiri.so +0 -0
- data/lib/nokogiri/2.6/nokogiri.so +0 -0
- data/lib/nokogiri/2.7/nokogiri.so +0 -0
- data/lib/nokogiri/3.0/nokogiri.so +0 -0
- data/lib/nokogiri/version/constant.rb +1 -1
- data/lib/nokogiri/xml/builder.rb +38 -0
- data/lib/nokogiri/xml/document.rb +46 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fe6d40d6f53f4498d9cec7a6d2ae64157796549ec8c8a9a3187cb6da2230d00
|
4
|
+
data.tar.gz: a498a01f041d1ba989ff8001e4d345cc7924ee621cc01275f1d23cb1dac6e134
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6626aeab57c9373fe7d2e5cc313d238b20716814e64b7e1f796cc202c9aad9c121153b3c0d523ad0de284f2005fd3ce622c0795e46127ddbc6a384b1a995c6a6
|
7
|
+
data.tar.gz: ebd0f740c30c3d302e03aeaac4b23ddb3c67f6b55db354eaa42adc9223b763d5ce01c739bfabf9ed4f9875547cb0a7b005d7ae79e51fa0e576c01b846d77f80a
|
@@ -133,7 +133,7 @@ extern "C" {
|
|
133
133
|
#ifndef WITH_MODULES
|
134
134
|
#define WITH_MODULES
|
135
135
|
#endif
|
136
|
-
#define LIBXSLT_DEFAULT_PLUGINS_PATH() "/home/flavorjones/code/oss/nokogiri/ports/
|
136
|
+
#define LIBXSLT_DEFAULT_PLUGINS_PATH() "/home/flavorjones/code/oss/nokogiri/ports/i686-w64-mingw32/libxslt/1.1.34/lib/libxslt-plugins"
|
137
137
|
#endif
|
138
138
|
|
139
139
|
/**
|
data/ext/nokogiri/xml_node.c
CHANGED
@@ -69,6 +69,13 @@ relink_namespace(xmlNodePtr reparented)
|
|
69
69
|
/* Avoid segv when relinking against unlinked nodes. */
|
70
70
|
if (reparented->type != XML_ELEMENT_NODE || !reparented->parent) { return; }
|
71
71
|
|
72
|
+
/* Make sure that our reparented node has the correct namespaces */
|
73
|
+
if (!reparented->ns &&
|
74
|
+
(reparented->doc != (xmlDocPtr)reparented->parent) &&
|
75
|
+
(rb_iv_get(DOC_RUBY_OBJECT(reparented->doc), "@namespace_inheritance") == Qtrue)) {
|
76
|
+
xmlSetNs(reparented, reparented->parent->ns);
|
77
|
+
}
|
78
|
+
|
72
79
|
/* Search our parents for an existing definition */
|
73
80
|
if (reparented->nsDef) {
|
74
81
|
xmlNsPtr curr = reparented->nsDef;
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/lib/nokogiri/xml/builder.rb
CHANGED
@@ -196,6 +196,41 @@ module Nokogiri
|
|
196
196
|
#
|
197
197
|
# Note the "foo:object" tag.
|
198
198
|
#
|
199
|
+
# === Namespace inheritance
|
200
|
+
#
|
201
|
+
# In the Builder context, children will inherit their parent's namespace. This is the same
|
202
|
+
# behavior as if the underlying {XML::Document} set +namespace_inheritance+ to +true+:
|
203
|
+
#
|
204
|
+
# result = Nokogiri::XML::Builder.new do |xml|
|
205
|
+
# xml["soapenv"].Envelope("xmlns:soapenv" => "http://schemas.xmlsoap.org/soap/envelope/") do
|
206
|
+
# xml.Header
|
207
|
+
# end
|
208
|
+
# end
|
209
|
+
# result.doc.to_xml
|
210
|
+
# # => <?xml version="1.0" encoding="utf-8"?>
|
211
|
+
# # <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
|
212
|
+
# # <soapenv:Header/>
|
213
|
+
# # </soapenv:Envelope>
|
214
|
+
#
|
215
|
+
# Users may turn this behavior off by passing a keyword argument +namespace_inheritance:false+
|
216
|
+
# to the initializer:
|
217
|
+
#
|
218
|
+
# result = Nokogiri::XML::Builder.new(namespace_inheritance: false) do |xml|
|
219
|
+
# xml["soapenv"].Envelope("xmlns:soapenv" => "http://schemas.xmlsoap.org/soap/envelope/") do
|
220
|
+
# xml.Header
|
221
|
+
# xml["soapenv"].Body # users may explicitly opt into the namespace
|
222
|
+
# end
|
223
|
+
# end
|
224
|
+
# result.doc.to_xml
|
225
|
+
# # => <?xml version="1.0" encoding="utf-8"?>
|
226
|
+
# # <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
|
227
|
+
# # <Header/>
|
228
|
+
# # <soapenv:Body/>
|
229
|
+
# # </soapenv:Envelope>
|
230
|
+
#
|
231
|
+
# For more information on namespace inheritance, please see {XML::Document#namespace_inheritance}
|
232
|
+
#
|
233
|
+
#
|
199
234
|
# == Document Types
|
200
235
|
#
|
201
236
|
# To create a document type (DTD), access use the Builder#doc method to get
|
@@ -226,6 +261,8 @@ module Nokogiri
|
|
226
261
|
# </root>
|
227
262
|
#
|
228
263
|
class Builder
|
264
|
+
DEFAULT_DOCUMENT_OPTIONS = {namespace_inheritance: true}
|
265
|
+
|
229
266
|
# The current Document object being built
|
230
267
|
attr_accessor :doc
|
231
268
|
|
@@ -282,6 +319,7 @@ module Nokogiri
|
|
282
319
|
@arity = nil
|
283
320
|
@ns = nil
|
284
321
|
|
322
|
+
options = DEFAULT_DOCUMENT_OPTIONS.merge(options)
|
285
323
|
options.each do |k, v|
|
286
324
|
@doc.send(:"#{k}=", v)
|
287
325
|
end
|
@@ -113,9 +113,55 @@ module Nokogiri
|
|
113
113
|
# A list of Nokogiri::XML::SyntaxError found when parsing a document
|
114
114
|
attr_accessor :errors
|
115
115
|
|
116
|
+
# When true, reparented elements without a namespace will inherit their new parent's
|
117
|
+
# namespace (if one exists). Defaults to +false+.
|
118
|
+
#
|
119
|
+
# @example Default behavior of namespace inheritance
|
120
|
+
# xml = <<~EOF
|
121
|
+
# <root xmlns:foo="http://nokogiri.org/default_ns/test/foo">
|
122
|
+
# <foo:parent>
|
123
|
+
# </foo:parent>
|
124
|
+
# </root>
|
125
|
+
# EOF
|
126
|
+
# doc = Nokogiri::XML(xml)
|
127
|
+
# parent = doc.at_xpath("//foo:parent", "foo" => "http://nokogiri.org/default_ns/test/foo")
|
128
|
+
# parent.add_child("<child></child>")
|
129
|
+
# doc.to_xml
|
130
|
+
# # => <?xml version="1.0"?>
|
131
|
+
# # <root xmlns:foo="http://nokogiri.org/default_ns/test/foo">
|
132
|
+
# # <foo:parent>
|
133
|
+
# # <child/>
|
134
|
+
# # </foo:parent>
|
135
|
+
# # </root>
|
136
|
+
#
|
137
|
+
# @example Setting namespace inheritance to +true+
|
138
|
+
# xml = <<~EOF
|
139
|
+
# <root xmlns:foo="http://nokogiri.org/default_ns/test/foo">
|
140
|
+
# <foo:parent>
|
141
|
+
# </foo:parent>
|
142
|
+
# </root>
|
143
|
+
# EOF
|
144
|
+
# doc = Nokogiri::XML(xml)
|
145
|
+
# doc.namespace_inheritance = true
|
146
|
+
# parent = doc.at_xpath("//foo:parent", "foo" => "http://nokogiri.org/default_ns/test/foo")
|
147
|
+
# parent.add_child("<child></child>")
|
148
|
+
# doc.to_xml
|
149
|
+
# # => <?xml version="1.0"?>
|
150
|
+
# # <root xmlns:foo="http://nokogiri.org/default_ns/test/foo">
|
151
|
+
# # <foo:parent>
|
152
|
+
# # <foo:child/>
|
153
|
+
# # </foo:parent>
|
154
|
+
# # </root>
|
155
|
+
#
|
156
|
+
# @return [Boolean]
|
157
|
+
#
|
158
|
+
# @since v1.12.4
|
159
|
+
attr_accessor :namespace_inheritance
|
160
|
+
|
116
161
|
def initialize *args # :nodoc:
|
117
162
|
@errors = []
|
118
163
|
@decorators = nil
|
164
|
+
@namespace_inheritance = false
|
119
165
|
end
|
120
166
|
|
121
167
|
##
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nokogiri
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.12.
|
4
|
+
version: 1.12.4
|
5
5
|
platform: x86-mingw32
|
6
6
|
authors:
|
7
7
|
- Mike Dalessio
|
@@ -20,7 +20,7 @@ authors:
|
|
20
20
|
autorequire:
|
21
21
|
bindir: bin
|
22
22
|
cert_chain: []
|
23
|
-
date: 2021-08-
|
23
|
+
date: 2021-08-29 00:00:00.000000000 Z
|
24
24
|
dependencies:
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: racc
|