Forum Moderators: phranque

Message Too Old, No Replies

Including subsections of called document

Can an include call subsections of a file rather than only the entire file?

         

4thePegeh

7:34 pm on Mar 14, 2007 (gmt 0)

10+ Year Member



Is it possible to "shuffle" sections from two files into a third file?

I realize File A could use four includes to call include four distinct files.

But could file A achieve a similar result by calling subsections from only two files? For example:

Could file A include:

File B's section 1, then

file C's section 1, then

File B's section 2, then

file C's section 2.

If so, I would be pleased to study the documentation if someone could direct me to it. So far I have not grasped whether the above is possible from my reading of information at [httpd.apache.org...] and some related documentation.

jdMorgan

8:53 pm on Mar 14, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No, but what you call "File B" and File "C" could be themselves split into two sections each, so that file B includes File B Part 1 and File B part 2 and File C includes File C part 1 and File C part 2. It would then be a simple matter for File A to include File B part 1, File C part 1, File B part 2, and then File C part 2.

Divide, then conquer... :)

Jim

4thePegeh

9:29 pm on Mar 14, 2007 (gmt 0)

10+ Year Member



Thank you. What you are describing seems to be what I had in mind but failed to describe well.

In your version it looks as though there would be a total of three files:

File A

File B

File C

and File B would have two sections:

File B part 1

File C part 2

and File C would have two sections:

File C part 1

File C part 2

And then I could get file A to include the Parts out of order so their order of physical appearance in file A could be:

File B part 1

File C part 1

File B part 2

File C part 2

Correct?

If so, then that is what I wish to do.

If so, then which labels in the documentation would you suggest I look for to learn how to designate the sections or parts in file B and file C, and to learn how to specify in A, the sections or parts in B and C to be included in A?

jdMorgan

9:37 pm on Mar 14, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You need to physically split files B and C into two files each for a total of four files. That was my point.

You can then "re-build" file B by including its two parts in order, and re-build file C by including its two parts in order. File A can then be built by including the four parts which we called File B and File C in any order you like.

Jim

4thePegeh

9:48 pm on Mar 14, 2007 (gmt 0)

10+ Year Member



Ah, I see. Thank you.

I was hoping for a simpler solution than creating the 4 individual files.