Icon

XML Easy Reader demo - Jan 2022

XML Easy Reader demo
Owner with Pets Owner with Address Basic 2-d "table" - simplest format can beloaded without any configuration This example demonstrates a problemthat is resolved by the next example! Please note all components on this demoworkflow have been "unlinked" so that the democan be loaded quickly without a large number ofcomponent updates which would take time.This demo workflow is using the followingcomponents:XML Easy Reader 1 (v1.08, 7 June 2021)Open File or FolderBoth of these components are available on thehub athttps://hub.knime.com/takbb/spaces/Public/latest/Components To quickly view (in default editor/browser) any of the xmlfiles, configure the "Open File or Folder" component andenable (tick) the "Physically open... " box.Then execute the Open File or Folder component. The filewill then be opened in your default viewer. With it "unticked", the component simply creates andpasses the path as a flow variable to the XML Easy Readercomponent. Read XMLdemo1.xmlunpack everythingUnpack everythingdemo2.xmlremove grouping columnsdemo3.xmlremove grouping columnsUnpack everythingStraight unpack DOESN'T"fill down" !!Unpack address so they "fill down"remove grouping columnsdemo4.xmlclear "empty" cellsUnpack top levellocation of mapping filedemo4_mapping.csvUnpack pets so they "fill down"But notice how the "optional" elementsin the pets grouping has meant a mismatch indata so "Bugsy" the rabbit, has the breed"Cross-eyed Lion", which actually should attributed to Clarence the Catdemo5.xmlclear "empty" cellsremove grouping columnsUnpack pets so they "fill down"Unpack top levelUnpack top levelremove grouping columnsclear "empty" cellsUnpack streets and towns so they "fill down"location of mapping filedemo7_mapping.csvdemo5.xmlcorrect typescorrect typesSome Animals have gone missing! And there's a mismatch of Animal with itsname because of "optional"elements in the XML thatEasy Reader cannot know aboutConfig restricts collectionto only the //pets subtreealong with elements outside ofthat subtree as definedunder "key elements"This time we have restricted the collectionof elements byreference in the mapping filerather than by "collection subtree"Read XMLMapping file continues to be usedto prevent name-clashWe are now returning onlyowner nameand petsas defined in the config under "collect from subtree"(workaround: Remove superfluous"del:"columns that have been included in mapping fileto avoid name clash)Read XMLBasic with additional groupingelement but still tabularRead XMLNested data now has many to onegroupingRead XMLNested data now has many to onegrouping and we use a mapping file nowbecause "name" clashes betweenperson and petRead XMLMapping file continues to be usedto prevent name-clashand we configre the component sothat it knows that items below//pets/petcontain optional entries, so it watches out and pads these accordingly wherethey are missingUnpack top levelEasy Reader config made aware of"optional group elements"//pets/petso pets and their names now match upUnpack address so they "fill down"Unpack pets so they "fill down"Clarence is now the Cross Eyed Lion, because of config change on the Easy Readercomponentremove grouping columnsclear "empty" cellsRead XMLOwners and Addresses (restricted by mapping file entries) XML Easy Reader 1 Open File or Folder Ungroup Ungroup Open File or Folder Missing ValueColumn Filter Open File or Folder Missing ValueColumn Filter Ungroup Ungroup Missing ValueColumn Filter Open File or Folder Empty Collectionto Missing Ungroup Open File or Folder Ungroup Open File or Folder Empty Collectionto Missing Missing ValueColumn Filter Ungroup Ungroup Ungroup Missing ValueColumn Filter Empty Collectionto Missing Ungroup Open File or Folder Open File or Folder Column AutoType Cast Column AutoType Cast Column AutoType Cast Column AutoType Cast Column AutoType Cast XML Easy Reader 1 Column Filter XML Easy Reader 1 XML Easy Reader 1 XML Easy Reader 1 XML Easy Reader 1 Ungroup Column AutoType Cast Ungroup Ungroup Missing ValueColumn Filter Empty Collectionto Missing XML Easy Reader 1 Owner with Pets Owner with Address Basic 2-d "table" - simplest format can beloaded without any configuration This example demonstrates a problemthat is resolved by the next example! Please note all components on this demoworkflow have been "unlinked" so that the democan be loaded quickly without a large number ofcomponent updates which would take time.This demo workflow is using the followingcomponents:XML Easy Reader 1 (v1.08, 7 June 2021)Open File or FolderBoth of these components are available on thehub athttps://hub.knime.com/takbb/spaces/Public/latest/Components To quickly view (in default editor/browser) any of the xmlfiles, configure the "Open File or Folder" component andenable (tick) the "Physically open... " box.Then execute the Open File or Folder component. The filewill then be opened in your default viewer. With it "unticked", the component simply creates andpasses the path as a flow variable to the XML Easy Readercomponent. Read XMLdemo1.xmlunpack everythingUnpack everythingdemo2.xmlremove grouping columnsdemo3.xmlremove grouping columnsUnpack everythingStraight unpack DOESN'T"fill down" !!Unpack address so they "fill down"remove grouping columnsdemo4.xmlclear "empty" cellsUnpack top levellocation of mapping filedemo4_mapping.csvUnpack pets so they "fill down"But notice how the "optional" elementsin the pets grouping has meant a mismatch indata so "Bugsy" the rabbit, has the breed"Cross-eyed Lion", which actually should attributed to Clarence the Catdemo5.xmlclear "empty" cellsremove grouping columnsUnpack pets so they "fill down"Unpack top levelUnpack top levelremove grouping columnsclear "empty" cellsUnpack streets and towns so they "fill down"location of mapping filedemo7_mapping.csvdemo5.xmlcorrect typescorrect typesSome Animals have gone missing! And there's a mismatch of Animal with itsname because of "optional"elements in the XML thatEasy Reader cannot know aboutConfig restricts collectionto only the //pets subtreealong with elements outside ofthat subtree as definedunder "key elements"This time we have restricted the collectionof elements byreference in the mapping filerather than by "collection subtree"Read XMLMapping file continues to be usedto prevent name-clashWe are now returning onlyowner nameand petsas defined in the config under "collect from subtree"(workaround: Remove superfluous"del:"columns that have been included in mapping fileto avoid name clash)Read XMLBasic with additional groupingelement but still tabularRead XMLNested data now has many to onegroupingRead XMLNested data now has many to onegrouping and we use a mapping file nowbecause "name" clashes betweenperson and petRead XMLMapping file continues to be usedto prevent name-clashand we configre the component sothat it knows that items below//pets/petcontain optional entries, so it watches out and pads these accordingly wherethey are missingUnpack top levelEasy Reader config made aware of"optional group elements"//pets/petso pets and their names now match upUnpack address so they "fill down"Unpack pets so they "fill down"Clarence is now the Cross Eyed Lion, because of config change on the Easy Readercomponentremove grouping columnsclear "empty" cellsRead XMLOwners and Addresses (restricted by mapping file entries)XML Easy Reader 1 Open File or Folder Ungroup Ungroup Open File or Folder Missing ValueColumn Filter Open File or Folder Missing ValueColumn Filter Ungroup Ungroup Missing ValueColumn Filter Open File or Folder Empty Collectionto Missing Ungroup Open File or Folder Ungroup Open File or Folder Empty Collectionto Missing Missing ValueColumn Filter Ungroup Ungroup Ungroup Missing ValueColumn Filter Empty Collectionto Missing Ungroup Open File or Folder Open File or Folder Column AutoType Cast Column AutoType Cast Column AutoType Cast Column AutoType Cast Column AutoType Cast XML Easy Reader 1 Column Filter XML Easy Reader 1 XML Easy Reader 1 XML Easy Reader 1 XML Easy Reader 1 Ungroup Column AutoType Cast Ungroup Ungroup Missing ValueColumn Filter Empty Collectionto Missing XML Easy Reader 1

Nodes

Extensions

Links