iCalender gives error Mismatched 'BEGIN' and 'END' (BEGIN:VCALENDAR , END:VCALENDAR) - icalendar

my iCalender script gives me an error Mismatched 'BEGIN' and 'END' (BEGIN:VCALENDAR , END:VCALENDAR).
but it seems that it is correct.
below is my ical file script
BEGIN:VCALENDAR
PRODID:-//Microsoft Corporation//Outlook 14.0 MIMEDIR//EN
VERSION:2.0
METHOD:PUBLISH
X-MS-OLK-FORCEINSPECTOROPEN:TRUE
BEGIN:VEVENT
CLASS:PUBLIC
CREATED:20160617T000000Z
DESCRIPTION:Overview
DTEND;VALUE=DATE:20160621T000000Z
DTSTAMP:20160621T000000Z
DTSTART;VALUE=DATE:20160621T000000Z
LOCATION:Westin Galleria Houston, Texas
PRIORITY:5
SEQUENCE:0
SUMMARY;LANGUAGE=en-us:ABCD
TRANSP:TRANSPARENT UID:57639008a1a2d
X-ALT-DESC;FMTTYPE=text/html:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//E N">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html\; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server v ersion 14.03.0123.002">
<TITLE>ABCD</TI TLE>
</HEAD>
<BODY>
</BODY>
</HTML>
X-MICROSOFT-CDO-BUSYSTATUS:FREE
X-MICROSOFT-CDO-IMPORTANCE:1
X-MICROSOFT-DISALLOW-COUNTER:FALSE
X-MS-OLK-AUTOFILLLOCATION:FALSE
X-MS-OLK-CONFTYPE:0
BEGIN:VALARM
TRIGGER:-PT1080M
ACTION:DISPLAY
DESCRIPTION:Reminder
END:VALARM
END:VEVENT
END:VCALENDAR
iCalender validation report
Errors
Mismatched 'BEGIN' and 'END' (BEGIN:VCALENDAR , END:VCALENDAR) near line # 65
Missing VCALENDAR object near line # 1Reference: RFC 5545 3.4 iCalendar Object
Please help,

The X-ALT-DESC property value is not folded correctly. Whenever a property value has multiple lines, each additional line must be prepended with one whitespace character, like so:
X-PROP:one
two
three
Also, your UID property is not on its own line.

Sorry I am a little late here, but it looks like you used the icalendar validator at http://icalendar.org/validator.html. I am the author of that validator and after researching the issue I found a bug with the validator related to your feed. The bug was incorrectly including the blank space after the word "VCALENDAR" to determine the mismatch condition. There was a space after the "BEGIN:VCALENDAR " but not after "END:VCALENDAR", resulting in the incorrect validation error. White space at the end of the line is not an error, so this has been corrected. And you can try re-validating your feed again to see the updated results.

your DTSTART:
DTSTART;VALUE=DATE:20160621T000000Z
and your DTEND:
DTEND;VALUE=DATE:20160621T000000Z
have the same values.
RFC5545 specifies
The "DTEND" property for a "VEVENT" calendar component specifies the non-inclusive end of the event.
which means that your event is not-defined. if you wish the even to last one day, just remove the DTEND
Also you specify a VALUE=DATE but give a DATE-TIME. Either change the property to VALUE=DATE-TIME or change the value to be a date:
DTSTART;VALUE=DATE:20160621

It may also be related to a bug in Exchange 2016:
If you have recurrent events and modify one of the instances, Exchange 2016 delivers invalid iCal data, i.e., the END:VCALENDAR is missing.
See here for my bug report:
https://social.technet.microsoft.com/Forums/office/en-US/9952d9ea-6040-46b8-93d7-f163c09acd70/bug-in-ews-invalid-ical-format-if-recurrent-event-modified?forum=exchangesvrdevelopment

Related

XMLParser encounter invalid tags

I'm writing an RSS reader app using Swift. I use the built-in class XMLParser to do the parsing job.
The XMLParser would stop when encounter some strange tags, for instance, <figure>(This tag is matched by end tag </figure>). The error code is 76(tagNameMismatchError).
I extract the part causing the tagNameMismatchError from xml:
<figure tabindex="0" draggable="false" class="ss-img-wrapper" contenteditable="false"><img src="https://cdn.sspai.com/2019/08/19/34d2340bbf2cbc3b08ffe4fe1594168d.png" alt=""><figcaption class="ss-image-caption">图 / iHelpBR</figcaption></figure>
Why this error(tagNameMismatchError)? It is <figure> an invalid tag or something else?
Besides, I can't predict what possible tags could come from possible feeds.
The problem is the img tag, which is not terminated. This is not valid XML. HTML is more lax regarding closing tags than XML is. Insert a </img> or change the img tag to be <img src=... /> and it will work.
If you ever need to confirm that the content is valid XML, you can also save it to a file and then use the command line xmllint which will report (emphasis added):
parser error : Opening and ending tag mismatch: img line 1 and figure
Bottom line, you’ll need to fix the XML, or use a HTML parser (such as Hpple or NDHpple) instead.

how to parse malformed HTML using HTML::Parser

I am trying to parse an HTML with meta-tag as :
<meta name="id" content=""12345.this.is.a.sample:id:required.67890"#abc.com">
The html::parser returns this "" empty value instead of the actual value required. This is my code depicting the start event handler:
sub start {
my ($self, $tagname, $attr, $attrseq, $origtext) = #_;
if ($tagname eq 'meta') {
print "Meta found: ", $attr->{ name }, $attr->{content}, "\n";
}
}
Any ideas on how to get the required value?
I think a quote from Charles Babbage is appropriate here:
On two occasions I have been asked, — “Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?” […] I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
– Passages from the Life of a Philosopher (1864)
This is known as the Garbage-In, Garbage-Out (GIGO) principle. In your case, you have malformed HTML. If you feed that to an HTML parser, you'll necessarily get bogus output. The HTML standard is already quite lax to deal with all kinds of common errors, but your example is much more broken.
There is, of course, one solution: Don't treat your input as HTML, but as some derived format where your example happens to be legal input. You'd have to write a custom parser of your own or adapt an existing HTML parser to your needs, but that would work.
However, I think that fixing the source of the input would be easier than writing your own parser. All that is needed is the quotes inside the attribute to be escaped, or for the attribute to use single quotes:
<meta name="id" content=""12345.this.is.a.sample:id:required.67890"#abc.com">
<meta name="id" content='"12345.this.is.a.sample:id:required.67890"#abc.com'>
Okay, found out a way to get the content for this particular problem. The $origtext variable above gets the value of the argspec identifier text which is defined in the documentation as :
Text causes the source text (including markup element delimiters) to be passed.
So, basically,
print $origtext;
would give me the source text as output:
<meta name="id" content=""12345.this.is.a.sample:id:required.67890"#abc.com">
I can use a regex to exploit this value contained in $origtext and get the desired stuff.

HTML4.01 Strict ARIA Doctype for Validation via W3C Validator

Is there any <!doctype> for "HTML 4.01 Strict Markup + ARIA"?
Also am currently having HTML 4.01 Strict <!DOCTYPE>, I obviously get an error while validating my page with the W3C Validator.
Is there any solution to this problem?
Also when I use the Accessibilty Toolbar, I get the following error pointing to the line after the closing HTML tag:
Line 256, Column 1: character data is not allowed here
Content-Disposition: form-data; name="charset"
You have used character data somewhere it is not permitted to appear.
Mistakes that can cause this error include:
putting text directly in the body of the document without wrapping it in a container element (such as a <p>aragraph</p>), or
forgetting to quote an attribute value (where characters such as "%" and "/" are common, but cannot appear without surrounding quotes), or
using XHTML-style self-closing tags (such as <meta ... />) in HTML 4.01 or earlier. To fix, remove the extra slash ('/') character. For more information about the reasons for this, see Empty elements in SGML, HTML, XML, and XHTML.
There is no published DTD for HTML 4.01 + ARIA. It would be possible to write one, if only there were a stable, exact document that specifies the allowed ARIA attributes and the HTML 4.01 elements on which they may be used. Using WAI-ARIA in HTML is still a WD only, and calls itself “a practical guide”. And I’m not sure how it should be interpreted. I guess the simplest, and possibly the only realistic, approach would be to write a DTD that allows all ARIA attributes on all elements, with the same set of values for all elements, even thoughh this would violate many of the recommendations.
The other question seems to be unrelated, and should probably be asked as a separate question. And you should probably explain what accessibility toolbar you are referring to and what your HTML document contains.

Simple paragraph break

I am trying to make a simple paragraph break in my text file (name.js) so that when the iphone pulls the information (name.js) there is not one big run on paragraph. I have looked and looked and cannot find this information can you help me project is due at this time...
try something like this in the javascript:
var pageBreak = document.createElement("/p");
document.getElementsByTagName("tagToInsertBreakAfter")[0].appendChild(pageBreak);
I am away from my machine so i cannot check but try a \n or \r\n
Well it had to be one or the other it'
<br />
i just hacked a widget and tried it. By the way i am assuming you are doing some like the following
// localised strings
var backString_01 = "World Second <br />offers unbeatable exchange rates and exceptional service for foreign exchange and international payments";
then outputting to the document with
document.getElementById('services_headline').innerHTML = backString_01;
With the element in the html something like ....
<div id="services_headline" apple-part="com.apple.Dashcode.part.text" class="apple-text apple-no-children" apple-default-image-visibility="hidden" apple-text-overflow="ellipsis"></div>

Facelets charset problem

In my earlier post there was a problem with JSF charset handling, but also the other part of the problem was MySQL connection parameters for inserting data into db. The problem was solved.
But, I migrated the same application from JSP to facelets and the same problem happened again. Characters from input fields are replaced when inserting to database (č is replaced with Ä), but data inserted into db from sql scripts with proper charset are displayed correctly. I'm still using registered filter and page templates are used with head meta tag as following:
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-2">
If I insert into h:form tag the following attribute:
acceptcharset="iso-8859-2"
I get correct characters in Firefox, but not in IE7.
Is there anything else I should do to make it work?
Thanks in advance.
Add the following line to the filter:
response.setContentType("text/html;charset=ISO-8859-2");
Don't use acceptcharset attribute. IE has serious bugs with it.
Also, when you're using a <?xml?> declaration in top of Facelets XHTML page, ensure that it's using the desired charset or just remove the whole declaration, it's not strictly required.
<?xml version="1.0" encoding="ISO-8859-2"?>
i think you can see the implementation of org.springframework.web.filter.CharacterEncodingFilter
and you can start your tomcat by adding -Dfile.encoding=ISO-8859-2 as jvm arguments