hexpat-0.20.13: XML parser/formatter based on expat

Safe Haskell | None
Language | Haskell98

Text.XML.Expat.Internal.Qualified

Description

In the default representation, qualified tag and attribute names such as <abc:hello> are represented just as a string containing a colon, e.g. "abc:hello".

This module provides functionality to handle these more intelligently, splitting all tag and attribute names into their Prefix and LocalPart components.

Synopsis

- data QName text = QName {
  - qnPrefix :: Maybe text
  - qnLocalPart :: !text
  }
- type QAttributes text = Attributes (QName text) text
- mkQName :: text -> text -> QName text
- mkAnQName :: text -> QName text
- toQualified :: forall n (c :: Type -> Type) text. (NodeClass n c, GenericXMLString text) => n c text text -> n c (QName text) text
- fromQualified :: forall n (c :: Type -> Type) text. (NodeClass n c, GenericXMLString text) => n c (QName text) text -> n c text text

# Documentation

data QName text Source #

A qualified name.

Qualified names have two parts, a prefix and a local part. The local part is the name of the tag. The prefix scopes that name to a particular group of legal tags.

The prefix will usually be associated with a namespace URI. This is usually achieved by using xmlns attributes to bind prefixes to URIs.

Constructors

QName |

Fields

- qnPrefix :: Maybe text
- qnLocalPart :: !text

#### Instances

Instances details

NFData text => NFData (QName text) Source # |
Instance details Defined in Text.XML.Expat.Internal.Qualified Methods rnf :: QName text -> () Source #
Show text => Show (QName text) Source # |
Instance details Defined in Text.XML.Expat.Internal.Qualified Methods showsPrec :: Int -> QName text -> ShowS Source # show :: QName text -> String Source # showList :: [QName text] -> ShowS Source #
Eq text => Eq (QName text) Source # |
Instance details Defined in Text.XML.Expat.Internal.Qualified Methods (==) :: QName text -> QName text -> Bool Source # (/=) :: QName text -> QName text -> Bool Source #

type QAttributes text = Attributes (QName text) text Source #

Type shortcut for attributes with qualified names

mkQName :: text -> text -> QName text Source #

Make a new QName from a prefix and localPart.

mkAnQName :: text -> QName text Source #

Make a new QName with no prefix.

toQualified :: forall n (c :: Type -> Type) text. (NodeClass n c, GenericXMLString text) => n c text text -> n c (QName text) text Source #

fromQualified :: forall n (c :: Type -> Type) text. (NodeClass n c, GenericXMLString text) => n c (QName text) text -> n c text text Source #