Icon

XML Easy Reader demo

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! 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. demo1.xmlunpack everythingUnpack everythingdemo2.xmlremove grouping columnsdemo3.xmlremove grouping columnsUnpack everythingStraight unpack DOESN'T"fill down" !!Unpack top levelremove grouping columnsUnpack address so they "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 top levelUnpack 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 Readercomponentclear "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 typesNotice blanks in the Name and Age columnsName and Age columnsare now populated correctlySome Animals have gone missing! And there's a mismatch of Animal with itsname because of "optional"elements in the XML thatEasy Reader cannot know aboutEasy Reader config made aware of"optional group elements"//pets/petso pets and their names now match upConfig 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 XMLBasic row-based dataRead 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 missingRead XMLMapping file continues to be usedto prevent name-clashWe are now returning onlyowner nameand petsas defined in the config under "collect from subtree"Read XMLOwners and Addresses (restricted by mapping file entries)(workaround: Remove superfluous"del:"columns that have been included in mapping fileto avoid name clash) 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 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 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 Column AutoType Cast Column AutoType Cast Column AutoType Cast XML Easy Reader 1 XML Easy Reader 1 XML Easy Reader 1 XML Easy Reader 1 XML Easy Reader 1 XML Easy Reader 1 XML Easy Reader 1 Column Filter 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! 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. demo1.xmlunpack everythingUnpack everythingdemo2.xmlremove grouping columnsdemo3.xmlremove grouping columnsUnpack everythingStraight unpack DOESN'T"fill down" !!Unpack top levelremove grouping columnsUnpack address so they "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 top levelUnpack 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 Readercomponentclear "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 typesNotice blanks in the Name and Age columnsName and Age columnsare now populated correctlySome Animals have gone missing! And there's a mismatch of Animal with itsname because of "optional"elements in the XML thatEasy Reader cannot know aboutEasy Reader config made aware of"optional group elements"//pets/petso pets and their names now match upConfig 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 XMLBasic row-based dataRead 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 missingRead XMLMapping file continues to be usedto prevent name-clashWe are now returning onlyowner nameand petsas defined in the config under "collect from subtree"Read XMLOwners and Addresses (restricted by mapping file entries)(workaround: Remove superfluous"del:"columns that have been included in mapping fileto avoid name clash)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 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 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 Column AutoType Cast Column AutoType Cast Column AutoType Cast XML Easy Reader 1 XML Easy Reader 1 XML Easy Reader 1 XML Easy Reader 1 XML Easy Reader 1 XML Easy Reader 1 XML Easy Reader 1 Column Filter

Nodes

Extensions

Links