Getting meta tag attribute with HTML Agility Pack using XPATH





```
META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1" />
TITLE>Microsoft Corporation
META http-equiv="PICS-Label" content="(PICS-1.1 "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0))" />
META NAME="KEYWORDS" CONTENT="products; headlines; downloads; news; Web site; what's new; solutions; services; software; contests; corporate news;" />
META NAME="DESCRIPTION" CONTENT="The entry page to Microsoft's Web site. Find software, solutions, answers, support, and Microsoft news." />
META NAME="MS.LOCALE" CONTENT="EN-US" />
META NAME="CATEGORY" CONTENT="home page" />

```

I'd like to know what XPATH I would need to get the value of the Content attribute of the Category meta tag using HTML Agility Pack. (I removed the first < of each line in the html code so it would post).
For a long time HtmlAgilityPack [didn't had the ability to directly query an attribute value](http://htmlagilitypack.codeplex.com/Thread/View.aspx?ThreadId=1720). You had to loop over the list of meta nodes. Here's one way - 



```
var doc = new HtmlDocument();
doc.LoadHtml(htmlString);

var list = doc.DocumentNode.SelectNodes("//meta"); 
foreach (var node in list)
{
    string content = node.GetAttributeValue("content", "");
}

```

But looks like in there is an [experimental xpath release](http://htmlagilitypack.codeplex.com/releases/view/46681) that will let you do that. 



```
doc.Document.SelectNodes("//meta/@content") 

```

will return a list of HtmlAttribute objects.
In your example, the category data is stored in an attribute, rather than within the node itself.


You therefore need to use the XPath: `/product[1]/categories/category/@path` where the @ shows you want to target an attribute. As I mentioned, the sample code will be updated soon. Here's the info I received:

·         To set the “Fit one full page to screen” option

o    This is done on the article metadata, the field is fitToScreen

{

                “entityName”: “helloworld”,

                “entityTitle”: “Hello World”,

                “entityType”: “article”,

                “fitToScreen”: true,

                …

}

·         To set the “Enable horizontal swiping within PDF”

o    This is done when uploading PDF to the ingestion service, set the URL parameter hoirzontalSwipe

[https://ings.publish.adobe.io/publication/{{publication-id}}/article/{{entityName}};version={{versio...](https://ings.publish.adobe.io/publication/{{publication-id}}/article/{{entityName}};version={{version}}/contents/folio?horizontalSwipe=true)

o    By default, the horitzontalSwipe is set to false (i.e. if the URL parameter is not set)

o    If the horitzontalSwipe is set to true but fitToScreen is set to false, then the ingestion service will throw an error




[View solution in original post](/t5/adobe-experience-manager-mobile/upload-pdf-files-to-aemm-with-options/m-p/198598#M915) Whew. Lot of topics in that short post!

First, the <Art>/Article tag is a container/grouping tag that wraps around a bunch of content tags (like <P>, <H2>, <L>, <Table>) to create a logical area of the larger document.

<Art> tags are created for each story/article dragged into the Articles Panel. How you group your stories is up to you. Some examples:

* If it's a small document, like a fact sheet or brochure, then 1 <Art> in the PDF might be sufficient for the whole document.
* If it's a 10-chapter book, then each chapter could be a separate <Art>, and there would be 10 (or more) <Art> tags in the entire PDF.
* A magazine would have 1 <Art> tag for each feature story.

 

Quote: "*Any other accessibility tips would be greatly appreciated*"

 

Ha ha! That's like asking how to use Photoshop in a little post in this forum. Accessibility is an extremely broad, but specific, requirement and you really need formal training in how to do it with InDesign. Look for classes from:

* Chad Chelius at LinkedIn Learning
* CreativePro's InDesign Accessibility Summit <https://creativepro.com/indesign-accessibility-summit/>
* Bevi Chagnon at [www.PubCom.com/classes](http://www.PubCom.com/classes)

 



 Design + Accessibility | Author | Designer | Programmer | Trainer How you do this will depend on a number of factors: since you haven't tried to explain in any detail, I'll assume you know nothing, and just give you the basics.  

  

The easiest way to do this is to read the text file into a single string, and then use the .NET framework to find the match:  


```
Dim text As String = File.ReadAllText("D:\Temp\MyFile.txt")
Dim index As Integer = text.IndexOf("hello")
If index >= 0 Then
   ' String is in file, starting at character "index"
End If
```
  

There are other ways, but that is pretty much the simplest. data list tag in html You will want to look at the httpwebrequest class and its methods. You can feed it a URL and get back the source (page) to do with as you will. The MSDN articles that come up of you google httpwebrequest will help you. an x-http-method header as part of a post request your link leads to an inactive developer message btw.

rest does not yet provide a way to list tags except by id. you can use the standard api with the same oauth2 access key that you would use for rest… using the data object you would want to query on the group table using the groupname field. Try the following:



  




 (adsbygoogle = window.adsbygoogle || []).push({});
 
  


```
import httplib
from urlparse import urlparse

def url\_exists(url):
    _, host, path, _, _, _ = urlparse(url)
    conn = httplib.HTTPConnection(host)
    conn.request('HEAD', path)
    return conn.getresponse().status < 400

        

        
        
        
 (adsbygoogle = window.adsbygoogle || []).push({});
 
        

    
``` i got it over the internet.

var args = array.prototype.slice.call(arguments);