diff --git a/source/detail/serialization/xlsx_consumer.cpp b/source/detail/serialization/xlsx_consumer.cpp index b356dcd2..fce83802 100644 --- a/source/detail/serialization/xlsx_consumer.cpp +++ b/source/detail/serialization/xlsx_consumer.cpp @@ -165,10 +165,16 @@ std::vector xlsx_consumer::read_relationships(const path &part) const auto target_mode = parser.attribute_present("TargetMode") ? parser.attribute("TargetMode") : xlnt::target_mode::internal; + auto target = xlnt::uri(parser.attribute("Target")); + + if (target.path().is_absolute() && target_mode == target_mode::internal) + { + target = uri(target.path().relative_to(path(part.string()).resolve(path("/"))).string()); + } + relationships.emplace_back(parser.attribute("Id"), parser.attribute("Type"), - xlnt::uri(part.string()), xlnt::uri(parser.attribute("Target")), - target_mode); + xlnt::uri(part.string()), target, target_mode); expect_end_element(qn("relationships", "Relationship")); }