Using Xpath ScratchPad with a Webstore template.

The xpath ScratchPad tool is a easy way to test xpath statements without actually running an import. The user just needs to find a sample xml file from their webstore.

Assuming the webstore has been setup (running and importing in orders), the user can go to Webstore > Webstore Sync > Choose the template > click EDIT then click next until the source Values page. From here, click “ScratchPad” on the the top right corner.

scratch-pad

This will bring up the XPath Scratchpad window. From here click LOAD and browse to the location of the sample xml file. If you need an xml file, the path \\ServerName\ACCTivateData\Log\WebStore will have a list of dates and times of when the webstore was ran. When choosing a date folder and time folder, choose the file with a variation of “Order-1.xml”. This is generally the file the xpath be written from.

webstore-xml

Once a xml file is chosen the contents will be filled in the “XML” box. Before beginning to write a statement, be sure to remove any namespace information as conflicts may occur when writing a statement with the raw namespace defined. The namespace is highlighted in the example below.

removing-namespace

After the namespace is removed, the user can now create match and select statements then review the output.

xpath-without-namespace

After reviewing and verifying the path is correct, you can add a new xpath on the Source Values page using the corresponding match and select statement written using the XPath ScratchPad.

For a list on how to write xpaths click here or check out some common xpath problems with xpath examples here

For more information about this and other XML features, check out our docs page.