moxml 0.4.0 → 0.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d2a6cac576f8bc4819d27a22825f7ab11fd35a004113c70d6c4986adf542d844
4
- data.tar.gz: 8f7cbfa869296d65002a6d2b74399ede57b16c2bcc25f4c4c7e9ccab611f5be6
3
+ metadata.gz: 837d647ac39dac23aae2389b6150eafbecf405788f5c62e09af616aa0644715c
4
+ data.tar.gz: c7a427e0cf685dd3121e0e5afdfcf388a0d18c52766f22717c8bb8b7d02cecf2
5
5
  SHA512:
6
- metadata.gz: e5b6bf4775a56f4d4fd18cea369d84463085c4df14bdef0ee0ad818ff734864e658bfc41c81bf0e6989cdff2b4ffdff69c74bfc512a7b2debecadd7a892432b6
7
- data.tar.gz: daf1b85571460bbde0553a52603f255577918dd9eb2e9faf37cb156738277bef51d5bfadc207b74d17177d3f281d9ae4ce4b2db571e22ad112bb595291d124c8
6
+ metadata.gz: 2e59a3705d492b273708e0d82fa10078be543c4aca86daa7fe7c7c1e90b13ecc774ac89934458b3373d46045e4a2f3fa7eef46172045bbe8ae4fd5105c03030c
7
+ data.tar.gz: c8f15cc1577514a368e551444f0e0759170e77e5969a383e0b43025d733e75be8ec99869e43f9fd459f2ac1c0d0c422b26d9e98c73823d76fd18d585d11ebdff
@@ -852,26 +852,6 @@ module Moxml
852
852
  XmlEmitter.doctype_xml(dt.root_name, dt.public_id, dt.system_id)
853
853
  end
854
854
 
855
- def entity_refs?(element)
856
- element.is_a?(::Leptris::XML::Element) &&
857
- !attachments.get(element, :entity_refs).to_a.empty?
858
- end
859
-
860
- # Registry-based entity references are not in the native tree,
861
- # so the native serializer cannot see them; compose the element
862
- # from the wrapper-visible children instead.
863
- def serialize_entity_bearing_element(element, options)
864
- name = element.prefix ? "#{element.prefix}:#{element.name}" : element.name
865
- attrs = element.attribute_nodes.map do |attr|
866
- %( #{attr.name}="#{XmlEmitter.escape_attribute(attr.value)}")
867
- end.join
868
- decls = element.namespace_definitions.map do |ns|
869
- ns.prefix ? %( xmlns:#{ns.prefix}="#{ns.href}") : %( xmlns="#{ns.href}")
870
- end.join
871
- inner = children(element).map { |child| raw_serialize(child, options) }.join
872
- "<#{name}#{decls}#{attrs}>#{inner}</#{name}>"
873
- end
874
-
875
855
  def sax_parse(xml, handler)
876
856
  bridge = LeptrisSAXBridge.new(handler)
877
857
  xml_string = xml.is_a?(IO) || xml.is_a?(::StringIO) ? xml.read : xml.to_s
@@ -1060,6 +1060,11 @@ module Moxml
1060
1060
  # output keeps the walker.
1061
1061
  return nil if output.include?("xmlns")
1062
1062
 
1063
+ # The native serializer escapes non-ASCII codepoints in
1064
+ # attribute values as numeric character references
1065
+ # (x="&#xA9;"); the walker emits literal UTF-8
1066
+ return nil if output.include?("&#x")
1067
+
1063
1068
  # Layout: pull closing tags onto the last child's line
1064
1069
  output = output.gsub(/\n[ \t]*(<\/[\w.:-]+>)/, '\1')
1065
1070
 
@@ -1073,7 +1078,6 @@ module Moxml
1073
1078
 
1074
1079
  # Native escapes attribute apostrophes; moxml keeps them literal
1075
1080
  output.gsub("&apos;", "'")
1076
-
1077
1081
  end
1078
1082
 
1079
1083
  # Shallow duplication: copies the node itself (name, attrs, namespaces)
data/lib/moxml/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Moxml
4
- VERSION = "0.4.0"
4
+ VERSION = "0.5.0"
5
5
  end
@@ -95,10 +95,6 @@ module Moxml
95
95
  source = generator.process(proc_ast)
96
96
 
97
97
  CONTEXT.evaluate(source)
98
- ensure
99
- @literal_id = 0
100
- @predicate_nodesets.clear
101
- @predicate_indexes.clear
102
98
  end
103
99
 
104
100
  # Process a single XPath AST node
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moxml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.