G
grant
Hi,
I am new to xml - xsl but wonder if someone could help me with an
issue. Maybe an explanation of how to get to the result too
I have an xml structure for a menu and i need to create an xsl to
transform it into html to dynamically create the menu.
The xml structure cant be changed so that's not an option.
The xml structure is as follows:
<?xml version="1.0"?>
<commandResult>
<data>
<searchData>
<searchName>Web Access Menu</searchName>
<searchId>80000000000001D0</searchId>
<listView><name>Web Access Menu</name><label>Web Access
Menu</label></listView>
<searchMeta>
<label>Web Access Menu</label>
<tableData>
<tableId>8000000000000119</tableId>
<accessPermissions>
<read/>
</accessPermissions>
<tableQuickSearch>
<rId>8000000000000278</rId>
</tableQuickSearch>
</tableData>
<queryId>8000000000000997</queryId>
<disconnected>0</disconnected>
<resultsListLimit>100</resultsListLimit>
<searchParameter>
<parameterFieldMeta>
<fieldName>Type</fieldName>
<fieldId>8000000000001A7C</fieldId>
<rType>rText</rType>
<dataAttribute>0</dataAttribute>
<maxCharacters>10</maxCharacters><isOptional>0</isOptional>
<defaultConditionValue>0</defaultConditionValue>
<hasDefault>0</hasDefault>
<label>Type</label>
<ordinal>1</ordinal>
</parameterFieldMeta>
<operator>Equals</operator>
</searchParameter>
<searchFields>
<searchFieldMeta>
<fieldName>URL</fieldName>
<fieldId>8000000000001A80</fieldId>
<rType>rText</rType>
<dataAttribute>0</dataAttribute>
<maxCharacters>100</maxCharacters><label>URL</label>
<ordinal>0</ordinal><visible>1</visible>
</searchFieldMeta>
<searchFieldMeta>
<fieldName>Target</fieldName>
<fieldId>8000000000001A7D</fieldId>
<rType>rText</rType>
<dataAttribute>0</dataAttribute>
<maxCharacters>10</maxCharacters><label>Target</label>
<ordinal>1</ordinal><visible>1</visible>
</searchFieldMeta>
<searchFieldMeta>
<fieldName>Description</fieldName>
<fieldId>8000000000001A81</fieldId>
<rType>rText</rType>
<dataAttribute>0</dataAttribute>
<maxCharacters>100</maxCharacters><label>Description</label>
<ordinal>2</ordinal><visible>1</visible>
</searchFieldMeta>
</searchFields>
<availableFields>
</availableFields>
</searchMeta>
<searchResults>
<resultsListCount>2</resultsListCount>
<recordSelection>
<startRecordNumber>0</startRecordNumber>
<numberOfRecords>2</numberOfRecords>
</recordSelection>
<searchRow>
<recordId>0000000000000001</recordId>
<fieldValue>forgotpassword.asp</fieldValue>
<fieldValue>_self</fieldValue>
<fieldValue>forgot password</fieldValue>
</searchRow>
<searchRow>
<recordId>0000000000000002</recordId>
<fieldValue>home.asp</fieldValue>
<fieldValue>_self</fieldValue>
<fieldValue>Home</fieldValue>
</searchRow>
</searchResults>
<searchCriteria>
<parameterValue>a</parameterValue>
<orConditions>0</orConditions>
</searchCriteria>
</searchData>
</data>
</commandResult>
As you can see its not too friendly but there is a node called
/commandResult/data/searchData/searchMeta/searchFields/searchFieldMeta
that contains the field names and another under
/commandResult/data/searchData/searchResults/searchRow that contains
the values for the fields.
How can I construct an XSL document that will create a HTML table for
each of the field name nodes and give me the data for <A> hyperlinks
etc..
I cant seem to work out how to link the parent to child nodes (if
that's the right terminology)
Please can someone help me.
Thanks in advance
Grant
I am new to xml - xsl but wonder if someone could help me with an
issue. Maybe an explanation of how to get to the result too
I have an xml structure for a menu and i need to create an xsl to
transform it into html to dynamically create the menu.
The xml structure cant be changed so that's not an option.
The xml structure is as follows:
<?xml version="1.0"?>
<commandResult>
<data>
<searchData>
<searchName>Web Access Menu</searchName>
<searchId>80000000000001D0</searchId>
<listView><name>Web Access Menu</name><label>Web Access
Menu</label></listView>
<searchMeta>
<label>Web Access Menu</label>
<tableData>
<tableId>8000000000000119</tableId>
<accessPermissions>
<read/>
</accessPermissions>
<tableQuickSearch>
<rId>8000000000000278</rId>
</tableQuickSearch>
</tableData>
<queryId>8000000000000997</queryId>
<disconnected>0</disconnected>
<resultsListLimit>100</resultsListLimit>
<searchParameter>
<parameterFieldMeta>
<fieldName>Type</fieldName>
<fieldId>8000000000001A7C</fieldId>
<rType>rText</rType>
<dataAttribute>0</dataAttribute>
<maxCharacters>10</maxCharacters><isOptional>0</isOptional>
<defaultConditionValue>0</defaultConditionValue>
<hasDefault>0</hasDefault>
<label>Type</label>
<ordinal>1</ordinal>
</parameterFieldMeta>
<operator>Equals</operator>
</searchParameter>
<searchFields>
<searchFieldMeta>
<fieldName>URL</fieldName>
<fieldId>8000000000001A80</fieldId>
<rType>rText</rType>
<dataAttribute>0</dataAttribute>
<maxCharacters>100</maxCharacters><label>URL</label>
<ordinal>0</ordinal><visible>1</visible>
</searchFieldMeta>
<searchFieldMeta>
<fieldName>Target</fieldName>
<fieldId>8000000000001A7D</fieldId>
<rType>rText</rType>
<dataAttribute>0</dataAttribute>
<maxCharacters>10</maxCharacters><label>Target</label>
<ordinal>1</ordinal><visible>1</visible>
</searchFieldMeta>
<searchFieldMeta>
<fieldName>Description</fieldName>
<fieldId>8000000000001A81</fieldId>
<rType>rText</rType>
<dataAttribute>0</dataAttribute>
<maxCharacters>100</maxCharacters><label>Description</label>
<ordinal>2</ordinal><visible>1</visible>
</searchFieldMeta>
</searchFields>
<availableFields>
</availableFields>
</searchMeta>
<searchResults>
<resultsListCount>2</resultsListCount>
<recordSelection>
<startRecordNumber>0</startRecordNumber>
<numberOfRecords>2</numberOfRecords>
</recordSelection>
<searchRow>
<recordId>0000000000000001</recordId>
<fieldValue>forgotpassword.asp</fieldValue>
<fieldValue>_self</fieldValue>
<fieldValue>forgot password</fieldValue>
</searchRow>
<searchRow>
<recordId>0000000000000002</recordId>
<fieldValue>home.asp</fieldValue>
<fieldValue>_self</fieldValue>
<fieldValue>Home</fieldValue>
</searchRow>
</searchResults>
<searchCriteria>
<parameterValue>a</parameterValue>
<orConditions>0</orConditions>
</searchCriteria>
</searchData>
</data>
</commandResult>
As you can see its not too friendly but there is a node called
/commandResult/data/searchData/searchMeta/searchFields/searchFieldMeta
that contains the field names and another under
/commandResult/data/searchData/searchResults/searchRow that contains
the values for the fields.
How can I construct an XSL document that will create a HTML table for
each of the field name nodes and give me the data for <A> hyperlinks
etc..
I cant seem to work out how to link the parent to child nodes (if
that's the right terminology)
Please can someone help me.
Thanks in advance
Grant