Show Table of Contents
2.32. Configuring YAML Streams
Procedure 2.1. Task
- Configure your reader to process YAML files as shown:
<?xml version="1.0"?> <smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd" xmlns:yaml="http://www.milyn.org/xsd/smooks/yaml-1.4.xsd"> <yaml:reader/> </smooks-resource-list> - Configure the YAML stream to contain multiple documents. The reader handles this by adding a document element as a child of the root element. An XML-serialized YAML stream with one empty YAML document looks like this:
<yaml> <document> </document> </yaml> - Configure Smooks programmatically to read a YAML configuration by exploiting the
YamlReaderConfiguratorclass:Smooks smooks = new Smooks(); smooks.setReaderConfig(new YamlReaderConfigurator() .setRootName("root") .setDocumentName("doc") .setArrayElementName("e")) .setAliasStrategy(AliasStrategy.REFER_RESOLVE) .setAnchorAttributeName("anchor") .setAliasAttributeName("alias"); // Use Smooks as normal...

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.