Skip to content

Commit 9f43ed9

Browse files
committed
Don't use self-closing tags until Haml fixes problem with haml_tag.
1 parent 038a5a4 commit 9f43ed9

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

lib/rdf/rdfxml/writer/haml_templates.rb

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ class Writer
3838
- if expanded_type.start_with?('_:')
3939
- haml_tag(get_qname(RDF.type), "rdf:nodeID" => expanded_type[2..-1])
4040
-else
41-
- haml_tag(get_qname(RDF.type), "rdf:resource" => expanded_type)
41+
- # FIXME: closing tag forces close tag, as :/ is not honored in 5.0.1
42+
- haml_tag(get_qname(RDF.type), "", "rdf:resource" => expanded_type)
4243
- predicates.each do |p|
4344
= yield(p)
4445
),
@@ -59,9 +60,11 @@ class Writer
5960
- haml_tag(property, :"<", "xml:lang" => object.language, "rdf:datatype" => (object.datatype unless object.plain?)) do
6061
= object.value.to_s.encode(xml: :text)
6162
- elsif object.node?
62-
- haml_tag(property, :"/", "rdf:nodeID" => object.id)
63+
- # FIXME: closing tag forces close tag, as :/ is not honored in 5.0.1
64+
- haml_tag(property, "", "rdf:nodeID" => object.id)
6365
- else
64-
- haml_tag(property, :"/", "rdf:resource" => relativize(object))
66+
- # FIXME: closing tag forces close tag, as :/ is not honored in 5.0.1
67+
- haml_tag(property, "", "rdf:resource" => relativize(object))
6568
),
6669

6770
# Outpust for a list
@@ -75,9 +78,11 @@ class Writer
7578
- if recurse && res = yield(object)
7679
= res
7780
- elsif object.node?
78-
- haml_tag(get_qname(RDF.Description), :"/", "rdf:nodeID" => (object.id if ref_count(object) > 1))
81+
- # FIXME: closing tag forces close tag, as :/ is not honored in 5.0.1
82+
- haml_tag(get_qname(RDF.Description), "", "rdf:nodeID" => (object.id if ref_count(object) > 1))
7983
- else
80-
- haml_tag(get_qname(RDF.Description), :"/", "rdf:about" => relativize(object))
84+
- # FIXME: closing tag forces close tag, as :/ is not honored in 5.0.1
85+
- haml_tag(get_qname(RDF.Description), "", "rdf:about" => relativize(object))
8186
),
8287
}
8388
HAML_TEMPLATES = {base: BASE_HAML}

spec/writer_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,9 +691,9 @@ class FOO < RDF::Vocabulary("http://foo/"); end
691691
m.entries.each do |t|
692692
next unless t.positive_test? && t.evaluate?
693693
# Literal serialization adds namespace definitions
694-
next if t.subject =~ /rdfms-xml-literal-namespaces|xml-canon/
695694

696695
specify "#{t.name}" do
696+
pending if t.name == 'xml-canon-test001'
697697
unless defined?(::Nokogiri)
698698
pending("XML-C14XL") if t.name == "xml-canon-test001"
699699
end

0 commit comments

Comments
 (0)