I am having problems trying to retrieve an xml attribute name into a jq grid when the attribute name contains a hyphen. I have no problems retrieving other attributes without hyphens and element names with or without hyphens
Have I made a silly mistake?
XML data:
1 2 3 4 5 6 7 8 9 10 11 |
<record-list> <record-series channel="www.BBC%20NEWS.co.un" series-id="1665"> <schedule-record-id>3937</schedule-record-id> <current-start>20210506033000 +0100</current-start> <programme-title lang="eng">Click</programme-title> <programme-desc lang="eng">We explore how biases built into everyday technologies impact people's lives and how the tech industry is trying to address it.</programme-desc> <crid>/b-3N3K2/6</crid> <lang>eng</lang> </record-series> </record-list> |
ColModel:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
colModel: [ { label: 'Id', name: 'series-id', width: 65, xmlmap: '[series-id]' }, { label: 'Channel', name: 'channel', width: 90, xmlmap: '[channel]' }, { label: 'Next/Last', name: 'current-start', width: 110, xmlmap: 'current-start' }, { label: 'Series CRID', name: 'crid', width: 100, xmlmap: 'crid' }, { label: 'Title', name: 'programme-title', width: 180, xmlmap: 'programme-title' }, { label: 'Description', name: 'programme-desc', width: 180, xmlmap: 'programme-desc' }, { label: 'Record ID', name: 'record-id', width: 65, xmlmap: 'schedule-record-id' }, { label: 'Lang', name: 'lang', width: 55, xmlmap: 'lang' } ], xmlReader: { root:"record-list", row:"record-series", repeatitems:false, id: "[series-id]" }, |
Every column apart from the Id column populate correctly.
MymsMan
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top