Haskell Language
XML
Zoeken…
Invoering
Codering en decodering van XML-documenten.
Een record coderen met behulp van de `xml`-bibliotheek
{-# LANGUAGE RecordWildCards #-}
import Text.XML.Light
data Package = Package
{ pOrderNo :: String
, pOrderPos :: String
, pBarcode :: String
, pNumber :: String
}
-- | Create XML from a Package
instance Node Package where
node qn Package {..} =
node qn
[ unode "package_number" pNumber
, unode "package_barcode" pBarcode
, unode "order_number" pOrderNo
, unode "order_position" pOrderPos
]
Modified text is an extract of the original Stack Overflow Documentation
Licentie onder CC BY-SA 3.0
Niet aangesloten bij Stack Overflow