Forum

Thread tagged as: Question

Editing XML

Hello,

I have a simple XML file that I use to parse information with an XMLHttpRequest however all I have found on the Perch website is the following:

https://grabaperch.com/features/html-xml-json

My file is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<buttons>
<buttontext1 hyperlink="/">Home</buttontext1>
<buttontext2 hyperlink="/link1">Link 1</buttontext2>
<buttontext3 hyperlink="/link2">Link 2</buttontext3>
<buttontext4 hyperlink="/link3">Link 3</buttontext4>
<buttontext5 hyperlink="/link4">Link 4</buttontext5>
<buttontext6 hyperlink="/link5">Link 5</buttontext6>
<buttontext7 hyperlink="/link6">Link 6</buttontext7>
</buttons>

I would like to be able to edit both the element and attribute data so they appear as fields in Perch but I'm not sure if typical .html templates can be used.

Thanks for any help

Garth Holmes

Garth Holmes 0 points

  • 4 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

Yes you can use .html templates, these are Perch templates they don't dictate the output. Create templates as usual but surround your Perch template tags with xml rather than html.