Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^5: Ordering meta tag attributes with HTML::Element

by Cow1337killr (Monk)
on Jun 24, 2016 at 00:04 UTC ( [id://1166453]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Ordering meta tag attributes with HTML::Element
in thread Ordering meta tags with HTML::Element

Your approach of hoping that the text will never contain 0name or 1content is also plausible...

I went to http://www.w3schools.com/tags/tag_meta.asp. I clicked the "Try it Yourself >>" button. I coded up changes to the HTML.

<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="description" content="Free Web tutorials"> <meta name="keywords" content="HTML,CSS,XML,JavaScript"> <meta name="author" content="Hege Refsnes"> <meta 0name="description" 1content="Free Web tutorials"> <meta 0name="keywords" 1content="HTML,CSS,XML,JavaScript"> <meta 0name="author" 1content="Hege Refsnes"> </head> <body> <p>All meta information goes in the head section...</p> </body> </html>

I clicked the "See Result >>" button.

It displayed with no complaints.

I ran it through the HTML checker at https://validator.w3.org/.

It complained.

I stored the webpage on my disk and brought up the webpage in Firefox.

It displayed the webpage.

So, as long as one is creating their own HTML and can control the process, then the original poster's code at Re^3: Ordering meta tag attributes with HTML::Element will work.

But, if one is spidering the Internet, who knows what garbage is out there?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1166453]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-25 07:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found