How can I access data from a ?stylesheet=true field? in RPE
I need to report on the section names of a test plan in RPE. I can access these names using the URI:
<?xml version="1.0" encoding="UTF-8" ?>
- <ns21:stylesheet xmlns:ns21="http://www.w3.org/1999/XSL/Transform" ttp://jazz.net/xmlns/alm/v0.1/" xmlns:ns6="http://purl.org/dc/terms/" ..............>
- <ns2:sections>
<ns2:section id="com.ibm.rqm.planning.editor.section.dynamicSection_1519188863945" name="H1 INTRODUCTION" />
<ns2:section id="com.ibm.rqm.planning.editor.section.planSummary" name="H2 Overview" />
<ns2:section id="com.ibm.rqm.planning.editor.section.dynamicSection_1519174175290" name="H3 Purpose" />
<ns2:section id="com.ibm.rqm.planning.editor.section.planTestScope" name="H4 Scope" />
<ns2:section id="com.ibm.rqm.planning.editor.section.dynamicSection_1519187707369" name="H5 Interrelationships" />
<ns2:section id="com.ibm.rqm.planning.editor.section.planNormativeInformative" name="H6 Referenced Documents" />
<ns2:section id="com.ibm.rqm.planning.editor.section.dynamicSection_1519176378808" name="H7 Abbreviations" />
<ns2:section id="com.ibm.rqm.planning.editor.section.dynamicSection_1518151700440" name="H8 Definitions" />
<ns2:section id="com.ibm.rqm.planning.editor.section.dynamicSection_1519176438106" name="H9 Document Preparation" />
<ns2:section id="com.ibm.rqm.planning.editor.section.dynamicSection_1518151324592" name="ANNEX A. Data Item Description Traceability" />
</ns2:sections>
</ns21:stylesheet>
Accepted answer
You need to edit qm.xsd schema so as to honor the dynamic sections. In RPE, you can open the schema in Editor and make the necessary changes. You should get the ID of your section (ex. "com.ibm.rqm.planning.editor.section.dynamicSection_1519188863945") and add the custom section definition inside these tags:<xs:element name="testplan">/<xs:complexType>/<xs:complexContent>/<xs:extension base="reportableArtifact">/<xs:sequence>
Insert the following:
<xs:element name="testplan">
<xs:complexType>
<xs:complexContent>
<xs:extension base="reportableArtifact">
<xs:sequence>
<xs:element maxOccurs="1" minOccurs="0" name="com.ibm.rqm.planning.editor.section.dynamicSection_1519188863945" type="xs:string">
<xs:annotation>
<xs:appinfo>
<label>H1 INTRODUCTION</label>
</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
Make sure that you insert the xml in the correct resource tag (<xs:element name="testplan">)
After saving the schema, testplan/dynamicSection_1519188863945 will return the data you are looking for.
Note that this data will be in JSON format and need to be parsed using JavaScript so.