Xmlbf: exported symbols usage examples

Symbols

  • Element No usage example found for this symbol :( Collapse [-]
    Text No usage example found for this symbol :( Collapse [-]
    dfpos No usage example found for this symbol :( Collapse [-]
    dfposM No usage example found for this symbol :( Collapse [-]
    dfpre No usage example found for this symbol :( Collapse [-]
    dfpreM No usage example found for this symbol :( Collapse [-]
    element See 6 Occurences [+] Collapse [-]
    Found in Xmlbf.Xeno from the package xmlbf-xeno
    -- | Parses a given UTF8-encoded raw XML fragment into @a@, using the @xeno@
    -- Haskell library, so all of @xeno@'s parsing quirks apply.
    --
    -- You can provide the output of this function as input to "Xmlbf"'s
    -- 'Xmlbf.runParser'.
    --
    -- The given XML can contain more zero or more text or element nodes.
    --
    -- Surrounding whitespace is not stripped.
    nodes
      :: B.ByteString                 -- ^ Raw XML fragment.
      -> Either String [Xmlbf.Node]   -- ^ 'Xmlbf.Node's from "Xmlbf"
    nodes = \bs -> case Xeno.parse ("<x>" <> bs <> "</x>") of
      Left e -> Left ("Malformed XML: " ++ show e)
      Right n -> element n >>= \(Xmlbf.Element "x" _ cs) -> pure cs
    
    --------------------------------------------------------------------------------
    --------------------------------------------------------------------------------
    -- Miscellaneous
    

    Found in Xmlbf.Xeno from the package xmlbf-xeno
    -- Xeno support
    
    -- | Convert a 'Xeno.Node' from "Xeno.DOM" into an 'Element' from "Xmlbf".
    element
      :: Xeno.Node -- ^ A 'Xeno.Node' from "Xeno.DOM".
      -> Either String Xmlbf.Node -- ^ A 'Xmlbf.Node' from "Xmlbf".
    element x = do
      n <- decodeUtf8 (Xeno.name x)
      as <- for (Xeno.attributes x) $ \(k,v) -> do
         (,) <$> decodeUtf8 k <*> unescapeXmlUtf8 v
      cs <- for (Xeno.contents x) $ \case
         Xeno.Element n1 -> element n1
         Xeno.Text bs -> Xmlbf.text <$> unescapeXmlUtf8 bs
         Xeno.CData bs -> Xmlbf.text <$> decodeUtf8 bs
      Xmlbf.element n (HM.fromList as) cs
    
    -- | Parses a given UTF8-encoded raw XML fragment into @a@, using the @xeno@
    -- Haskell library, so all of @xeno@'s parsing quirks apply.
    --
    -- You can provide the output of this function as input to "Xmlbf"'s
    

    Found in Xmlbf.Xeno from the package xmlbf-xeno
    import qualified Xmlbf
    
    --------------------------------------------------------------------------------
    -- Xeno support
    
    -- | Convert a 'Xeno.Node' from "Xeno.DOM" into an 'Element' from "Xmlbf".
    element
      :: Xeno.Node -- ^ A 'Xeno.Node' from "Xeno.DOM".
      -> Either String Xmlbf.Node -- ^ A 'Xmlbf.Node' from "Xmlbf".
    element x = do
      n <- decodeUtf8 (Xeno.name x)
      as <- for (Xeno.attributes x) $ \(k,v) -> do
         (,) <$> decodeUtf8 k <*> unescapeXmlUtf8 v
      cs <- for (Xeno.contents x) $ \case
         Xeno.Element n1 -> element n1
         Xeno.Text bs -> Xmlbf.text <$> unescapeXmlUtf8 bs
         Xeno.CData bs -> Xmlbf.text <$> decodeUtf8 bs
      Xmlbf.element n (HM.fromList as) cs
    
    -- | Parses a given UTF8-encoded raw XML fragment into @a@, using the @xeno@
    

    Found in Xmlbf.Xeno from the package xmlbf-xeno
    import qualified Data.Text.Lazy.Builder as TB
    import qualified Data.Text.Encoding as T
    import Data.Traversable (for)
    import qualified HTMLEntities.Decoder
    import qualified Xeno.DOM as Xeno
    import qualified Xmlbf
    
    --------------------------------------------------------------------------------
    -- Xeno support
    
    -- | Convert a 'Xeno.Node' from "Xeno.DOM" into an 'Element' from "Xmlbf".
    element
      :: Xeno.Node -- ^ A 'Xeno.Node' from "Xeno.DOM".
      -> Either String Xmlbf.Node -- ^ A 'Xmlbf.Node' from "Xmlbf".
    element x = do
      n <- decodeUtf8 (Xeno.name x)
      as <- for (Xeno.attributes x) $ \(k,v) -> do
         (,) <$> decodeUtf8 k <*> unescapeXmlUtf8 v
      cs <- for (Xeno.contents x) $ \case
         Xeno.Element n1 -> element n1
    

    Found in Xmlbf.Xeno from the package xmlbf-xeno
    import Data.Monoid ((<>))
    import qualified Data.Text as T
    import qualified Data.Text.Lazy as TL
    import qualified Data.Text.Lazy.Builder as TB
    import qualified Data.Text.Encoding as T
    import Data.Traversable (for)
    import qualified HTMLEntities.Decoder
    import qualified Xeno.DOM as Xeno
    import qualified Xmlbf
    
    --------------------------------------------------------------------------------
    -- Xeno support
    
    -- | Convert a 'Xeno.Node' from "Xeno.DOM" into an 'Element' from "Xmlbf".
    element
      :: Xeno.Node -- ^ A 'Xeno.Node' from "Xeno.DOM".
      -> Either String Xmlbf.Node -- ^ A 'Xmlbf.Node' from "Xmlbf".
    element x = do
      n <- decodeUtf8 (Xeno.name x)
      as <- for (Xeno.attributes x) $ \(k,v) -> do
    

    Found in Xmlbf.Xeno from the package xmlbf-xeno
    {-# LANGUAGE LambdaCase #-}
    {-# LANGUAGE OverloadedStrings #-}
    
    module Xmlbf.Xeno
     ( element
     , nodes
     ) where
    
    import qualified Data.Bifunctor as Bif
    import qualified Data.ByteString as B
    

    element' No usage example found for this symbol :( Collapse [-]
    encode No usage example found for this symbol :( Collapse [-]
    pAttr No usage example found for this symbol :( Collapse [-]
    pAttrs No usage example found for this symbol :( Collapse [-]
    pElement No usage example found for this symbol :( Collapse [-]
    pEndOfInput No usage example found for this symbol :( Collapse [-]
    pRead No usage example found for this symbol :( Collapse [-]
    pText No usage example found for this symbol :( Collapse [-]
    runParser No usage example found for this symbol :( Collapse [-]
    text See 2 Occurences [+] Collapse [-]
    Found in Xmlbf.Xeno from the package xmlbf-xeno
    --------------------------------------------------------------------------------
    -- Xeno support
    
    -- | Convert a 'Xeno.Node' from "Xeno.DOM" into an 'Element' from "Xmlbf".
    element
      :: Xeno.Node -- ^ A 'Xeno.Node' from "Xeno.DOM".
      -> Either String Xmlbf.Node -- ^ A 'Xmlbf.Node' from "Xmlbf".
    element x = do
      n <- decodeUtf8 (Xeno.name x)
      as <- for (Xeno.attributes x) $ \(k,v) -> do
         (,) <$> decodeUtf8 k <*> unescapeXmlUtf8 v
      cs <- for (Xeno.contents x) $ \case
         Xeno.Element n1 -> element n1
         Xeno.Text bs -> Xmlbf.text <$> unescapeXmlUtf8 bs
         Xeno.CData bs -> Xmlbf.text <$> decodeUtf8 bs
      Xmlbf.element n (HM.fromList as) cs
    
    -- | Parses a given UTF8-encoded raw XML fragment into @a@, using the @xeno@
    -- Haskell library, so all of @xeno@'s parsing quirks apply.
    --
    

    Found in Xmlbf.Xeno from the package xmlbf-xeno
    --------------------------------------------------------------------------------
    -- Xeno support
    
    -- | Convert a 'Xeno.Node' from "Xeno.DOM" into an 'Element' from "Xmlbf".
    element
      :: Xeno.Node -- ^ A 'Xeno.Node' from "Xeno.DOM".
      -> Either String Xmlbf.Node -- ^ A 'Xmlbf.Node' from "Xmlbf".
    element x = do
      n <- decodeUtf8 (Xeno.name x)
      as <- for (Xeno.attributes x) $ \(k,v) -> do
         (,) <$> decodeUtf8 k <*> unescapeXmlUtf8 v
      cs <- for (Xeno.contents x) $ \case
         Xeno.Element n1 -> element n1
         Xeno.Text bs -> Xmlbf.text <$> unescapeXmlUtf8 bs
         Xeno.CData bs -> Xmlbf.text <$> decodeUtf8 bs
      Xmlbf.element n (HM.fromList as) cs
    
    -- | Parses a given UTF8-encoded raw XML fragment into @a@, using the @xeno@
    -- Haskell library, so all of @xeno@'s parsing quirks apply.
    

    FromXml No usage example found for this symbol :( Collapse [-]
    Node No usage example found for this symbol :( Collapse [-]
    Parser No usage example found for this symbol :( Collapse [-]
    ToXml No usage example found for this symbol :( Collapse [-]