xml-mixup 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +21 -0
- data/lib/xml/mixup/version.rb +1 -1
- data/lib/xml/mixup.rb +5 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d499773a47584dea6c852e05b936bc6d3016a40d15f38ea232639be5c780263f
|
4
|
+
data.tar.gz: 59c83f7be03939874805ccb568f43319890fe6d487e35667c0bad9299b44cb3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0704ed43c0c1baa04006355fe16b8a5a0143218864a1c5eddb3dd7504465fd94347acf9fe8cb211032f9da74641670474e7d78b46a8f639fd2303a77400b0c86
|
7
|
+
data.tar.gz: 1bc1e91ccffb613993101c93e63fa888c3bb30e93b5b967a6f985f52ef492dca13567e4fea898e35303a5ca1da2c5acc79972e53c3f1c20992eaaabe0110a516
|
data/README.md
CHANGED
@@ -30,6 +30,19 @@ node = something.markup spec: [
|
|
30
30
|
|
31
31
|
doc = node.document
|
32
32
|
puts doc.to_xml
|
33
|
+
# => <?xml version="1.0"?>
|
34
|
+
# => <?xml-stylesheet href="/transform" type="text/xsl"?>
|
35
|
+
# => <!DOCTYPE html>
|
36
|
+
# => <html xmlns="http://www.w3.org/1999/xhtml">
|
37
|
+
# => <head>
|
38
|
+
# => <title>look ma, title</title>
|
39
|
+
# => <base href="http://the.base/url"/>
|
40
|
+
# => </head>
|
41
|
+
# => <body>
|
42
|
+
# => <h1>Illustrious Heading</h1>
|
43
|
+
# => <p>lolwut</p>
|
44
|
+
# => </body>
|
45
|
+
# => </html>
|
33
46
|
```
|
34
47
|
|
35
48
|
## Yet another XML markup generator?
|
@@ -185,6 +198,14 @@ Come on, you know how to do this:
|
|
185
198
|
Bug reports and pull requests are welcome at
|
186
199
|
https://github.com/doriantaylor/rb-xml-mixup.
|
187
200
|
|
201
|
+
## The Future
|
202
|
+
|
203
|
+
As mentioned, this is pretty much a straight-across port
|
204
|
+
of [Role::Markup::XML](https://metacpan.org/pod/Role::Markup::XML),
|
205
|
+
where it makes sense to bolt a bunch of `_FOO`-looking instance
|
206
|
+
methods onto an object so you can use them to make more streamlined
|
207
|
+
methods.
|
208
|
+
|
188
209
|
## License
|
189
210
|
|
190
211
|
This software is provided under
|
data/lib/xml/mixup/version.rb
CHANGED
data/lib/xml/mixup.rb
CHANGED
@@ -255,7 +255,11 @@ module XML::Mixup
|
|
255
255
|
sys ||= attr[:system] if attr[:system]
|
256
256
|
|
257
257
|
# XXX for some reason this is an *internal* subset?
|
258
|
-
|
258
|
+
# anyway these may not be strings and upstream is not forgiving
|
259
|
+
node = doc.create_internal_subset(root.to_s,
|
260
|
+
pub.nil? ? pub : pub.to_s,
|
261
|
+
sys.nil? ? sys : sys.to_s)
|
262
|
+
|
259
263
|
|
260
264
|
# at any rate it doesn't have to be explicitly attached
|
261
265
|
|