xeno 0.3.1 → 0.3.2
raw patch · 4 files changed
+24/−14 lines, 4 files
Files
- CHANGELOG.markdown +11/−8
- src/Xeno/DOM.hs +6/−5
- test/Main.hs +6/−0
- xeno.cabal +1/−1
CHANGELOG.markdown view
@@ -1,10 +1,13 @@-0.3-Fixed name parsing (for attributes and tags) so it conforms with the XML spec (qrilka)-Fixed parsing failure when root tag is preceded by white space (though without checking for white space characters specifically) (qrilka)-Added contribution guidelines (ocramz) + 0.3.2+ Fixed DOM parsing from bystrings with non-zero offset (qrilka)+ + 0.3+ Fixed name parsing (for attributes and tags) so it conforms with the XML spec (qrilka)+ Fixed parsing failure when root tag is preceded by white space (though without checking for white space characters specifically) (qrilka)+ Added contribution guidelines (ocramz) -0.2-Added CDATA support (Rembane) + 0.2+ Added CDATA support (Rembane) -0.1-First Hackage release+ 0.1+ First Hackage release
src/Xeno/DOM.hs view
@@ -138,6 +138,7 @@ -- characters Just 0x1 -> go (n+3) _ -> Nothing+ PS _ offset0 _ = str node = runST (do nil <- UMV.new 1000@@ -162,7 +163,7 @@ writeRef sizeRef (index + 5) do UMV.write v' index tag UMV.write v' (index + 1) tag_parent- UMV.write v' (index + 2) name_start+ UMV.write v' (index + 2) (name_start - offset0) UMV.write v' (index + 3) name_len UMV.write v' (index + 4) tag_end) (\(PS _ key_start key_len) (PS _ value_start value_len) -> do@@ -178,9 +179,9 @@ let tag = 0x02 do writeRef sizeRef (index + 5) do UMV.write v' index tag- UMV.write v' (index + 1) key_start+ UMV.write v' (index + 1) (key_start - offset0) UMV.write v' (index + 2) key_len- UMV.write v' (index + 3) value_start+ UMV.write v' (index + 3) (value_start - offset0) UMV.write v' (index + 4) value_len) (\_ -> return ()) (\(PS _ text_start text_len) -> do@@ -196,7 +197,7 @@ return v' do writeRef sizeRef (index + 3) do UMV.write v' index tag- UMV.write v' (index + 1) text_start+ UMV.write v' (index + 1) (text_start - offset0) UMV.write v' (index + 2) text_len) (\_ -> do v <- readSTRef vecRef@@ -220,7 +221,7 @@ return v' do writeRef sizeRef (index + 3) do UMV.write v' index tag- UMV.write v' (index + 1) cdata_start+ UMV.write v' (index + 1) (cdata_start - offset0) UMV.write v' (index + 2) cdata_len) str wet <- readSTRef vecRef
test/Main.hs view
@@ -5,6 +5,7 @@ module Main where import Data.ByteString (ByteString)+import qualified Data.ByteString as BS import Test.Hspec import Xeno.SAX import Xeno.DOM@@ -41,6 +42,11 @@ let docWithPrologue = "<?xml version=\"1.1\"?>\n<greeting>Hello, world!</greeting>" parsedRoot = fromRightE $ Xeno.DOM.parse docWithPrologue name parsedRoot `shouldBe` "greeting"++ it "DOM from bytestring substring" $ do+ let substr = BS.drop 5 "5<8& <valid>xml<here/></valid>"+ parsedRoot = fromRightE $ Xeno.DOM.parse substr+ name parsedRoot `shouldBe` "valid" -- If this works without crashing we're happy. let nsdoc = "<ns:tag os:attr=\"Namespaced attribute value\">Content.</ns:tag>"
xeno.cabal view
@@ -1,5 +1,5 @@ name: xeno-version: 0.3.1+version: 0.3.2 synopsis: A fast event-based XML parser in pure Haskell description: Please see README.md build-type: Simple