title: How to display selected attributes for selected levels in DOORS using DXL?
body: <p>I'm looking for some DXL/DOORS help...</p>
  
  <p>I have 3 modules: A, B, and C.  B is linked in to A, and C is linked in to B. So B is depth 1 and C is depth 2. I am trying to create a column in A that displays the object text, module name, and object number of the inlinked objects from B and C.  However, I do not want to display all 3 of these (text, name, number) for both B and C--instead I'd like to only display the object text from B and the module name and object number from C. Ideally I want the info from C to be in square brackets immediately following the info from B. I would like it to look like this:</p>
  
  <p>Within a column in A:
  "object text from B" ["module name of C" "object number of C"]</p>
  
  <p>I have used the wizard to create the below layout DXL script, but currently it shows all 3 pieces of information for both B and C. Does anyone have any suggestions on how to print out only object text from B (depth 1), followed by module name and object number from C (depth 2)?</p>
  
  <p>Note: In the below script, I tweaked the end to display s, p, and t in the order I would like them.</p>
  
  <pre><code>// DXL generated by DOORS traceability wizard on 27 October 2014.
  // Wizard version 2.0, DOORS version 9.5.2.1
  pragma runLim, 0
  const int indentStep = 360
  Buffer indentBuff = create
  Buffer lineBuff = create
  lineBuff = "______________________"
  string indentAllParagraphs(string s, bool addBullets, int addedIndent)
  {
      int numParas = 0
      RichTextParagraph rtp
      indentBuff = s
      for rtp in s do
      {
          numParas++
          Buffer t = create()
          t += rtp.text
          if (length(t) &gt; 0 )
          {
              bool hasBullet = rtp.isBullet
              int  indentLev = rtp.indentLevel
              indentBuff = applyTextFormattingToParagraph(indentBuff, hasBullet, indentLev+addedIndent, numParas)
          }
          delete(t)
      }
      return (numParas == 0 ? "" : tempStringOf(indentBuff))
  }
  int lines[2] = {0, 0}
  void adjustLines(int depth, showAtDepth) {
      int count
      for (count = 0; count &lt; 2; count++) {
          while (lines[depth-1] &lt; lines[count]) {
              if (depth == showAtDepth) displayRich("\\pard " " ")
              lines[depth-1]++
          }
      }
  }
  void showIn(Object o, int depth) {
      Link l
      LinkRef lr
      ModName_ otherMod = null
      Module linkMod = null
      ModuleVersion otherVersion = null
      Object othero
      string disp = null
      string s = null
      string plain, plainDisp
      int plainTextLen
      int count
      bool doneOne = false
      string linkModName = "*"
      for lr in all(o&lt;-linkModName) do {
          otherMod = module (sourceVersion lr)
          if (!null otherMod) {
              if ((!isDeleted otherMod) &amp;&amp; (null data(sourceVersion lr))) {
                  load((sourceVersion lr),false)
              }
          }
      }
      for l in all(o&lt;-linkModName) do {
          otherVersion = sourceVersion l
          otherMod = module(otherVersion)
          if (null otherMod || isDeleted otherMod) continue
          othero = source l
          if (null othero) {
              load(otherVersion,false)
          }
          othero = source l
          if (null othero) continue
          if (isDeleted othero) continue
          int oldLines = lines[depth-1]
          doneOne = true
          {
              s = name(otherMod)
              p = probeRichAttr_(othero,"Object Number", false)
              t = probeRichAttr_(othero,"Object Text", false)
              displayRich(t" ""["s" "p"]")
          }
          lines[depth-1] += 3
          if ( depth &lt; 2 ) {
              showIn(othero, depth+1)
          }
      }
  }
  showIn(obj,1)
  delete indentBuff
  delete lineBuff
  </code></pre>