Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SSIs - Including PART of an HTML file only

Posted on 2002-07-03
18
Medium Priority
?
150 Views
Last Modified: 2013-11-18
Is it possible to have an include take only part of the content of another HTML file, rather than the entire file?

For example, include.html contains the following HTML:
<p>Content one is here</p>
<p>Content two is here</p>
<p>Content three is here</p>

I want my include to parse only the second line of the include.html file ONLY, to produce:
<p>Content two is here</p>

I wonder if I could have some tags or comments around each line, and then tell the include which line to get by looking at the comment tags:

<!--one start-->
<p>Content one is here</p>
<!--one end-->
<!--two start-->
<p>Content two is here</p>
<!--two end-->
<!--three start-->
<p>Content three is here</p>
<!--three end-->

And the include would read:
<!--#include virtual="/include.html <!--three start--> to <!--three end--> " -->
0
Comment
Question by:EvanL
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
  • 4
  • +3
18 Comments
 
LVL 19

Expert Comment

by:webwoman
ID: 7127998
That's not how it works.

Why not break up the page into 3 includes, and redo the first page with the 3 includes, and use only the part you need on the other page?

You COULD conceivably use a javascript function to put the page into a variable and read out what you want from the entire HTML, but that's much more work than creating 3 includes. ;-)
0
 
LVL 1

Author Comment

by:EvanL
ID: 7128026
I only want to include part of the text from an HTML document, not the entire document.

I am unable to break up the page into three separate includes, as the page is dynamically generated.
0
 
LVL 18

Accepted Solution

by:
bruno earned 400 total points
ID: 7128044
You can use something like XMLHTTP to grab the data...

here is a basic FAQ:
http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=61
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7128213
If the page is dynamically generate, why not just dynamically generate what you need at load time.

Cd&
0
 
LVL 1

Author Comment

by:EvanL
ID: 7128267
Because I don't have control over what is generated at load time.  The page being generated contains <head> and <title> and <html> tags.  I was hoping to include everything after the <body> tag but before the </body> tag.
0
 
LVL 18

Expert Comment

by:bruno
ID: 7128285
I'll just pretend that I didn't even HAVE a comment there before.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7128361
Whose page is it that you do not have control of generation?

Cd&
0
 
LVL 1

Author Comment

by:EvanL
ID: 7128572
A page generated by a script off of an application service provider I subscribe to.
0
 
LVL 1

Author Comment

by:EvanL
ID: 7128585
brunobear, I'm still looking over the link you posted, but it seems more complicated than I'm willing to deal with.  Especially when the site you posted says that the links to download the XMLHTTP component are deadlinks.
0
 
LVL 18

Expert Comment

by:bruno
ID: 7128703
Evan,

that's because it's an OLD article, any MS server would most likely already have it installed.

For what you want to do, you are going to have to do something similar to that however...

Once you do it the first time, it won't be nearly as hard.

If you really want EVERYTHING between <body> and </body>  I could probably provide you with some very easy code to update to what you need.  If you are interested and can support ASP.


BRUNO
0
 
LVL 1

Author Comment

by:EvanL
ID: 7128754
The server is Unix, so ASP code is not really an option.  If coding is the solution, I'd be looking at CGI/Perl code.
0
 
LVL 18

Expert Comment

by:bruno
ID: 7128783
hmmm....can't help with that, but I would think they must have something similar...
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7129520
does your server allow <!--#exec cmd= ... --> ?
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7212813
This question has been abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.
<note>
   In the absence of responses, I may recommend DELETE unless it is clear
   to me that it has value as a PAQ.  Silence = you don't care
</note>

Cd&
0
 
LVL 18

Expert Comment

by:bruno
ID: 7213044
user abandoned...
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7240532
It is time to clean this abandoned question up.  

I am putting it on a clean up list for CS.

<recommendation>
points to brunobear

</recommendation>

If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.

Cd&
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7263479
Per recommendation, force-accepted.

Netminder
CS Moderator
0
 
LVL 18

Expert Comment

by:bruno
ID: 7264230
thanks
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question