Visual Web Ripper Logo Visual Web Ripper Logo
Welcome Guest Search | Active Topics | Log In | Register

Tag as favorite
Combining XPATH Statements to Form a Template
FtzCorp
#1 Posted : Thursday, January 06, 2011 10:18:13 AM
Groups: Registered
Joined: 1/6/2011
Posts: 2
I have a page that is basically a table of contents. The obstacle is that subsections are not nested within main sections. It's something like:

Code:

<table>
  <p>Section A</p>
  <table>SubSection A.1</table>
  <table>SubSection A.2</table>

  <p>Section B</p>
  <table>SubSection B.1</table>
  <table>SubSection B.2</table>
</table>


I have created an XPATH that uses the "OR" operator to combine the results of two statements. The result is a template list containing:

Code:

<p>Section X</p>
<table>SubSection X.1</table>
<table>SubSection X.2</table>



I grab the main section title as an element and then create a new, nested template for the subsections. I then collect subsection titles, etc. within that template.

So, the data I want is something like:

Code:

CONTENTS
  |
  |-->A
      |
      |-->1
      |
      |-->2
  |
  |-->B
      |
      |-->1
      |
      |-->2



But what I'm getting is:

Code:

CONTENTS
  |
  |-->A
  |
  |-->B
  |
  |-->"EMPTY"
         |
         |-->1
         |
         |-->2
  |
  |-->"EMPTY"
         |
         |-->1
         |
         |-->2


The result is that there is no connection between the main sections and their children. All of the subsections just point back to empty content.

The debug log suggests that the template area created by the OR'd XPATH statements is not treated as a single template, but instead as two templates.

I've tried different XPATH statements. I also tried creating two templates, but setting one as a "Selection" and pointing it to the other. But so far nothing's worked.

I'm attaching a stripped down version of the project which will hopefully make the issue clear.

Thanks!
File Attachment(s):
exampleproject_templateissue.rip (74kb) downloaded 25 time(s).
Sequentum Support
#2 Posted : Friday, January 07, 2011 8:28:39 PM

Groups: Administrators
Joined: 4/10/2010
Posts: 1,239
Location: Sydney, Australia
This is not so easy, but you need to use the SPAN XPath function. See attached project.
File Attachment(s):
exampleproject_templateissue.rip (74kb) downloaded 52 time(s).
FtzCorp
#3 Posted : Tuesday, January 11, 2011 9:42:29 AM
Groups: Registered
Joined: 1/6/2011
Posts: 2
That worked perfectly!

Thank you very much for your time.
Users browsing this topic
Guest
Tag as favorite
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF 1.9.4 RC1 | YAF © 2003-2009, Yet Another Forum.NET
This page was generated in 0.074 seconds.