How to query Content Property in Technical Documentation

Hi Team,

Could you please explain how we can query 'Content' property in tp_Block itemtype. 

As per my knowledge, all root and node elements along with id's will be wrapped up inside Content property/column in tp_Block table. If I have to find/fetch any id of certain elements like Title/Subtitle/Graphic, is there any way to achieve through Custom code? or should we have to write any SQL query in custom method.

Kindly help.

Thanks,

Sowmya

Parents
  • Hi Sowmya,

    it should be possible, but I haven´t seen a sample for this one yet. You can use a Method with an AML "get" query to get the "content" property of your tp_block item. With xpath you can then look for specific elements inside content. 

    I made some tests for this one in the past to get content of text elements for translating the content into another language. I don´t have a ready to use sample, cause I mainly played around with an xpath tester.

    One thing that I remember: Sometimes the content property does not contain the content in a valid xml format. When your tp_block element for example just contains sections, there will no be any root element. So instead of making an xpath query on the content itself, better use the full tp_block item. 

    Angela

  • Hi Angela,

    It would be great if you can share piece of code using XPath and querying Content elements. Sample piece of code.

    So that I also can try from my end and explore more on that.

    Thanks for your response.

    Thanks,

    Sowmya

Reply Children