INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

loop through xdocument openxml

loop through xdocument openxml

(OP)
<w:P>.....<w:P>
<w:p w:rsidR="00C72E37" w:rsidRDefault="00A27CF8" w:rsidP="00A27CF8">
<w:pPr>
<w:pStyle w:val="Description"/>
</w:pPr>
<w:r w:rsidRPr="00686C21">
<w:rPr>
<w:rStyle w:val="Habit"/>
</w:rPr>
<w:t>Trees, shrubs, lianas or herbaceous vines</w:t>
</w:r>

<w:p w:rsidR="00C72E37" w:rsidRDefault="00A27CF8">
<w:pPr>
<w:ind w:right="19"/>
</w:pPr>
<w:r>
<w:rPr>
.......
</w:rPr>
</w:r>
<w:r w:rsidRPr="00A27CF8">
<w:rPr>
<w:rStyle w:val="Family"/>
</w:rPr>
<w:t>SAPINDACEAE</w:t>
</w:r>
<w:r>
<w:rPr>
......
</w:rPr>
</w:r>
</w:p>
<w:P>.....<w:P>
<w:P>.....<w:P>




I need to loop through every <w:P> of the document
First need to find out it’s child <w :pPr> has child <w:pStyle> that contain w:val and get its value and <w:t>Trees, shrubs, lianas or herbaceous vines</w:t>
Then look at <w:P>’s other <w:r> children and find out if it’s any of child has
<w:rStyle w:val="name"/> and get it’s value and <w:t>SAPINDACEAE</w:t> value

So the result in key value dictionary

Style=” Description” : Text = “ Description”
Style = “Habit” : Text= ” Trees, shrubs, lianas or herbaceous vines”
Style= “Family” : Text = “SAPINDACEAE”

I’m using openxml document xdoument I need to find it's every style and their content from every <w:P>
And their text value
If some you know better way then please help me

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close