Jump to content

nonempty check for an element at the same level


Recommended Posts

Hi,

XSLT2.0

I am trying to find the element names and count which are nonempty at any level

Ex:

<custom-data>
  <schema>XXXschema>
  <object-name>YYYYY</object-name>
  <short-name>YYYYY</short-name>
  <object-type>TABLE</object-type>
  <mls-support-model/>
  <object-owner>PPPP</object-owner>
  <status/>
  <columns>
    <columns>
      <name>ID</name>
      <datatype>NUMBER</datatype>
      <length/>
      <precision/>
      <not-null>Yes</not-null>
      <comments>Identifier of the aging bucket.</comments>
      <flexfield-mapping/>
      <status/>
    </columns>
    <columns>
      <name>LAST_UPDATED_BY</name>
      <datatype>VARCHAR2</datatype>
      <length>64</length>
      <precision/>
      <not-null>Yes</not-null>
      <comments>Who column: indicates the user who last updated the row.</comments>
      <flexfield-mapping/>
      <status/>
    </columns>
    <columns>
      <name>ATTRIBUTE8</name>
      <datatype>VARCHAR2</datatype>
      <length>150</length>
      <precision/>
      <not-null/>
      <comments>Descriptive Flexfield: segment of the user descriptive flexfield.</comments>
      <flexfield-mapping>Aging </flexfield-mapping>
      <status/>
    </columns>
  </columns>
</custom-data>

I want to generate a table from the above data. The trick is, if there is no data for a column at any where, we need to exclude that column from the output table.

Ex: status,precision elements is empty for all the columns. SO we don't need to display status and precision column in output table.

How to get the number of elements without data at the same level and there names?

Thanks,

Samba.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...